rake db:migrate期间的错误

时间:2011-10-12 02:59:14

标签: ruby-on-rails ruby-on-rails-3 rake

我一直在尝试将我的应用程序从Rails 2.3升级到Rails 3.我让rails无故障,但没有任何错误,因为我没有迁移数据库。我已经解决了许多错误,试图运行rake db:migrate但是我无法通过这个......

rake aborted!
no such file to load -- config/environment

(See full trace by running task with --trace)

我的配置环境是

#Load the rails application
require File.expand_path('../application', __FILE__)

# Initialize the rails application
AppName::Application.initialize!

带痕迹

    rake aborted!
    no such file to load -- config/environment
   /Users/Kyle/Desktop/Rails_Projects/unitedaction3/lib/tasks/account.rake:2:in `require'
   /Users/Kyle/Desktop/Rails_Projects/unitedaction3/lib/tasks/account.rake:2:in `<top     (required)>'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.0/lib/rails/engine.rb:131:in `load'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.0/lib/rails/engine.rb:131:in `block in     load_tasks'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.0/lib/rails/engine.rb:131:in `each'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.0/lib/rails/engine.rb:131:in `load_tasks'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.0/lib/rails/application.rb:141:in   `load_tasks'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.0/lib/rails/application.rb:77:in `method_missing'
   /Users/Kyle/Desktop/Rails_Projects/unitedaction3/Rakefile:9:in `<top (required)>'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load_rakefile'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:495:in `raw_load_rakefile'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:78:in `block in   load_rakefile'
  /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:77:in `load_rakefile'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:61:in `block in run'
    /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
   /Users/Kyle/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我不确定您是否看过这个,但有一个rails插件提供rake任务来帮助进行此升级:https://github.com/rails/rails_upgrade

它给你:

rake rails:upgrade:check
rake rails:upgrade:configuration

但我认为您最终需要做的是生成一个新的空rails 3应用程序并将生成的config/environment文件复制到您的应用程序中。