RoR:rake db:schema:加载RAILS_ENV =生产错误

时间:2009-06-09 15:31:57

标签: ruby-on-rails

当我尝试在Rails中创建生产数据库时,我收到以下错误:

>rake db:schema:load RAILS_ENV=production --trace
rake db:schema:load RAILS_ENV=production --trace
(in C:/Users/user/Documents/Aptana Studio/truping)
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
no such file to load -- application
C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:155:in `require'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:262:in `require_or_load'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:221:in `depend_on'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:133:in `require_dependency'
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:18:in `define_dispatcher_callbacks'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `call'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `evaluate_method'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:166:in `call'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `run'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `each'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `send'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `run'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:277:in `run_callbacks'
C:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:559:in `send'
C:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:559:in `prepare_dispatcher'
C:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:173:in `process'
C:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in `send'
C:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in `run'
C:/Users/rrevi/Documents/Aptana Studio/truping/config/environment.rb:13
C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
C:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/misc.rake:3
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `execute'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in `invoke_with_call_chain'
C:/ruby/lib/ruby/1.8/monitor.rb:238:in `synchronize'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:588:in `invoke_prerequisites'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `each'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `invoke_prerequisites'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:577:in `invoke_with_call_chain'
C:/ruby/lib/ruby/1.8/monitor.rb:238:in `synchronize'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in `invoke'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in `invoke_task'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in `top_level'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31
C:/ruby/bin/rake:19:in `load'
C:/ruby/bin/rake:19

有人可以帮忙吗?我错过了宝石吗?

4 个答案:

答案 0 :(得分:6)

我认为您将Rails 2.2应用程序迁移到Rails 2.3。我在某个时候遇到过这个问题,但当我把application_controller.rb的副本作为application.rb时,它已经解决了。不确定真正的解决方案是什么,但它会让你的应用程序正常工作。

答案 1 :(得分:0)

我认为你错过了一颗宝石。你是怎么安装铁轨的?

此外,您是否准备好了有效的迁移?

答案 2 :(得分:0)

拉​​吉,

问题是我将Rails 2.3.2应用程序迁移到Rails 2.2.2环境。我通过将rails gems更新为Rails 2.3.2来修复应用程序项目。

就像你说的那样,Rails 2.2.2寻找application.rb,其中Rails 2.3.2寻找application_controller.rb

由于

答案 3 :(得分:0)

我的ISP只支持2.2.2所以我创建了一个符合application.rb的符号链接,它起作用了:)