当我运行rake db:migrate时,我收到以下错误。请让我知道原因。
环境 - Windows 7家庭高级版 Rails
F:/ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
F:/ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
F:/example/ROR//vendor/plugins/savage-beast/lib/tasks/savage_beast.rake:2
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in `load_without_new_constant_marking'
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in `load'
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
F:/ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in `load'
F:/ruby187/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:13
F:/ruby187/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:13:in `each'
F:/ruby187/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:13
F:/ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
F:/ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
F:/example/ROR/Rakefile:10
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
F:/ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
F:/Ruby187/bin/rake:19:in `load'
F:/Ruby187/bin/rake:19
答案 0 :(得分:0)
答案 1 :(得分:0)
您可以尝试以下命令rake db:create:all
后跟rake db:migrate
如果没有为项目设置数据库,则可能会出现此错误。你的app / config文件夹中有database.yml
个文件吗?