Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
When I add this gem into my app Gemfile : gem 'mongoid', '~> 2.3.2.
I'm unable to run any "rails g" command, it cause this stack trace :
/MY_PATH/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/whiny_nil.rb:48:in `method_missing': undefined method `values' for nil:NilClass (NoMethodError)
from /server/poker/vendor/bundle/ruby/1.9.1/gems/mongoid-2.3.2/lib/mongoid/railtie.rb:64:in `block in <class:Railtie>'
from /server/poker/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /server/poker/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run'
from /server/poker/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /server/poker/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each'
from /server/poker/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /server/poker/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!'
from /server/poker/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /server/poker/config/environment.rb:5:in `<top (required)>'
from /server/poker/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application.rb:83:in `require'
from /server/poker/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application.rb:83:in `require_environment!'
from /server/poker/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:22:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
@akshaynathan

This comment has been minimized.

Copy link

@akshaynathan akshaynathan commented Dec 8, 2011

Did you figure out the problem, I'm having a similar issue

@ludofleury

This comment has been minimized.

Copy link
Owner Author

@ludofleury ludofleury commented Dec 8, 2011

Hey, sorry, I fixed that long time ago and I can't remembe exactly how :(

@lucassus

This comment has been minimized.

Copy link

@lucassus lucassus commented Dec 30, 2011

Perhaps you have missing rails env section in you mongodb yaml config file.

@ludofleury

This comment has been minimized.

Copy link
Owner Author

@ludofleury ludofleury commented Dec 30, 2011

Ahhh yeah, it was exactly this, I removed the dev environment key... :) And finally I figured out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.