在rails上设置mongo db

时间:2012-05-09 12:58:42

标签: ruby-on-rails windows mongodb

我正在尝试使用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

0 个答案:

没有答案