我是RoR的新手并且一直在尝试完成入门链接
我遇到了几个问题:
rake db:create
rake server
Workstation是Ubuntu 12.04,Rails 3.2.8,Ruby 1.9.3p194。
mukeshk@ubuntu:~/NetBeansProjects/rails_work/blog/config$ rake db:create
(in /home/mukeshk/NetBeansProjects/rails_work/blog)
rake aborted!
undefined method `active_record' for #<Rails::Application::Configuration:0x00000002080410>
(See full trace by running task with --trace)
mukeshk@ubuntu:~/NetBeansProjects/rails_work/blog/config$ rails server
/home/mukeshk/.rvm/gems/ruby-1.9.3-p194@rails32/gems/railties-3.2.8/lib/rails/railtie/configuration.rb:85:in `method_missing': undefined method `active_record' for #<Rails::Application::Configuration:0x00000002a02f60> (NoMethodError)
from /home/mukeshk/NetBeansProjects/rails_work/blog/config/application.rb:54:in `<class:Application>'
from /home/mukeshk/NetBeansProjects/rails_work/blog/config/application.rb:13:in `<module:Blog>'
from /home/mukeshk/NetBeansProjects/rails_work/blog/config/application.rb:12:in `<top (required)>'
from /home/mukeshk/.rvm/gems/ruby-1.9.3-p194@rails32/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'
from /home/mukeshk/.rvm/gems/ruby-1.9.3-p194@rails32/gems/railties-3.2.8/lib/rails/commands.rb:53:in `block in <top (required)>'
from /home/mukeshk/.rvm/gems/ruby-1.9.3-p194@rails32/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
from /home/mukeshk/.rvm/gems/ruby-1.9.3-p194@rails32/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
mukeshk@ubuntu:~/NetBeansProjects/rails_work/blog/config$
答案 0 :(得分:0)
将此添加到您的config / application.rb:
require "active_record/railtie"