2012-12-03 32 views
6

私のVMの再起動後、いつでも私はこのエラーを受け取ります。私はRaces 3.2.3とMongodb w/Mongoidを使用しています。これはMongoDBとMongoidを使った私の最初のプロジェクトです。問題はそれと関係があります。モンゴが始まって走っているようです。完全なエラーメッセージは次のとおりです。NoMethodError:nilのための未定義メソッド ` - ':NilClass

NoMethodError: undefined method `-' for nil:NilClass 
from /home/development/.rvm/gems/[email protected]/gems/moped-1.2.5/lib/moped/cluster.rb:118:in `block in refresh' 
from /home/development/.rvm/gems/[email protected]/gems/moped-1.2.5/lib/moped/cluster.rb:125:in `each' 
from /home/development/.rvm/gems/[email protected]/gems/moped-1.2.5/lib/moped/cluster.rb:125:in `refresh' 
from /home/development/.rvm/gems/[email protected]/gems/moped-1.2.5/lib/moped/cluster.rb:78:in `nodes' 
from /home/development/.rvm/gems/[email protected]tionName/gems/moped-1.2.5/lib/moped/cluster.rb:187:in `with_secondary' 
from /home/development/.rvm/gems/[email protected]/gems/moped-1.2.5/lib/moped/session/context.rb:104:in `with_node' 
from /home/development/.rvm/gems/[email protected]/gems/moped-1.2.5/lib/moped/session/context.rb:43:in `query' 
from /home/development/.rvm/gems/[email protected]/gems/moped-1.2.5/lib/moped/query.rb:109:in `first' 
from /home/development/.rvm/gems/[email protected]/gems/mongoid-3.0.6/lib/mongoid/contextual/mongo.rb:201:in `first' 
from /home/development/.rvm/gems/[email protected]/gems/mongoid-3.0.6/lib/mongoid/contextual.rb:18:in `first' 
from /home/development/.rvm/gems/[email protected]/gems/mongoid-3.0.6/lib/mongoid/finders.rb:119:in `first' 
from (irb):3 
from /home/development/.rvm/gems/[email protected]/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start' 
from /home/development/.rvm/gems/[email protected]/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start' 
from /home/development/.rvm/gems/[email protected]/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>' 

答えて

4

mongoid.ymlのようなサウンドは上書きされています。 rails g mongoid:configを実行してもう一度試してみてください。乾杯。

+0

これはそれでした。あなたは天才の男です、ありがとう。 –

関連する問題