Skip to content

Commit

Permalink
downgrade activesupport to work around some bizarre gem interaction.
Browse files Browse the repository at this point in the history
With this Gemfile:

  source 'http://rubygems.org'
  gem 'json', '= 1.4.6'
  gem 'hashie', '= 0.2.2'
  gem 'activesupport', '= 3.0.2'
  gem 'feedzirra', '= 0.0.24'
  gem 'i18n', '= 0.4.2'

Run this script:

  require 'bundler'
  Bundler.require
  require 'json'
  require 'hashie'
  JSON.pretty_generate(Hashie::Mash.new)

And see this error:

/home/bronson/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.2/lib/active_support/json/encoding.rb:61:in `options_for': undefined method `merge' for #<JSON::Ext::Generator::State:0xa154e38> (NoMethodError)
  from /home/bronson/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.2/lib/active_support/json/encoding.rb:46:in `block in encode'
  from /home/bronson/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.2/lib/active_support/json/encoding.rb:77:in `check_for_circular_references'
  from /home/bronson/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.2/lib/active_support/json/encoding.rb:45:in `encode'
  from /home/bronson/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.2/lib/active_support/json/encoding.rb:30:in `encode'
  from /home/bronson/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.2/lib/active_support/core_ext/object/to_json.rb:20:in `to_json'
  from /home/bronson/.rvm/gems/ruby-1.9.2-p0/gems/hashie-0.2.2/lib/hashie/hash.rb:19:in `to_json'
  from /home/bronson/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/common.rb:264:in `generate'
  from /home/bronson/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/common.rb:264:in `pretty_generate'
  from console:5:in `<main>'
  • Loading branch information
bronson committed Feb 23, 2011
1 parent cb3b6ff commit 7eb9297
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
source 'http://rubygems.org'

# some weird interaction between a bunch of gems... Locking activesupport
# seems to fix it. If you can run 'JSON.pretty_generate(Hashie::Mash.new)'
# on the vim-script console then this is not a problem.
gem 'activesupport' ,'= 3.0.1'

# the pdf magic in mimemagic 0.1.8 is far too loose (recognizes textfiles and zipfiles as pdf)
# see comments on https://github.com/minad/mimemagic/commit/50078a4d52bb80f525784f6a4cb874fc7d2a03a0#commitcomment-280266
gem 'mimemagic' ,'= 0.1.7'

gem 'hpricot' ,'~> 0.8.2'
gem 'json' ,'~> 1.4.6'
gem 'gitrb' ,'~> 0.2.7'
gem 'bzip2-ruby' ,'~> 0.2.6'
gem 'mime-types' ,'~> 1.16'
gem 'mimemagic' ,'= 0.1.7' # can't use 0.1.8, see comments on https://github.com/minad/mimemagic/commit/50078a4d52bb80f525784f6a4cb874fc7d2a03a0#commitcomment-280266
gem 'octopussy' ,'~> 0.3.0'
gem 'hashie' ,'~> 0.2.2'
gem 'htmlentities','~> 4.2.1'
Expand Down
3 changes: 2 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
activesupport (3.0.4)
activesupport (3.0.1)
builder (3.0.0)
bzip2-ruby (0.2.7)
crack (0.1.6)
Expand Down Expand Up @@ -48,6 +48,7 @@ PLATFORMS
ruby

DEPENDENCIES
activesupport (= 3.0.1)
bzip2-ruby (~> 0.2.6)
erubis (~> 2.6.6)
feedzirra (~> 0.0.24)
Expand Down

0 comments on commit 7eb9297

Please sign in to comment.