0

我正在尝试使用 mongodb 在 Rails 应用程序上设置 ruby​​ 我已完成此链接http://www.mongodb.org/display/DOCS/Rails+3+-+Getting+Started中编写的步骤 ,但我仍然无法运行我的 Rails 应用程序。当我尝试生成控制器或迁移时,我收到此错误

C:\Users\Abhay\Documents\NetBeansProjects\my_app>rails generate controller demo
C:/Users/Abhay/Documents/NetBeansProjects/my_app/config/initializers/mongo.rb:1:
 uninitialized constant MongoMapper (NameError)
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/engine.r
 b:201
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/engine.r
 b:200:in `each'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/engine.r
 b:200
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initiali
 zable.rb:25:in `instance_exec'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initiali
  zable.rb:25:in `run'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initiali
  zable.rb:50:in `run_initializers'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initiali
  zable.rb:49:in `each'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initiali
    zable.rb:49:in `run_initializers'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/applicat
   ion.rb:134:in `initialize!'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/applicat
   ion.rb:77:in `send'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/applicat
   ion.rb:77:in `method_missing'
    from C:/Users/Abhay/Documents/NetBeansProjects/my_app/config/environment
     .rb:5
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/applicat
   ion.rb:103:in `require'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/applicat
   ion.rb:103:in `require_environment!'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/commands
    .rb:16
    from script/rails:6:in `require'
    from script/rails:6
4

0 回答 0