我将我的部署作为heroku指南。
但是当我使用'heroku rake db:migrate'命令时,会出现这些错误:
Running rake db:migrate attached to terminal... up, run.1
(in /app)
rake aborted!
no such file to load -- test/unit/error
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/app/.gems/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `block in require'
/app/.gems/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/app/.gems/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/app/.gems/gems/activesupport-2.2.2/lib/active_support/deprecation.rb:224:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/app/.gems/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `block in require'
/app/.gems/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/app/.gems/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/app/.gems/gems/activesupport-2.2.2/lib/active_support.rb:37:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/app/.gems/gems/rails-2.2.2/lib/tasks/misc.rake:11:in `<top (required)>'
/app/.gems/gems/rails-2.2.2/lib/tasks/rails.rb:4:in `load'
/app/.gems/gems/rails-2.2.2/lib/tasks/rails.rb:4:in `block in <top (required)>'
/app/.gems/gems/rails-2.2.2/lib/tasks/rails.rb:4:in `each'
/app/.gems/gems/rails-2.2.2/lib/tasks/rails.rb:4:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/app/Rakefile:10:in `<top (required)>'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/ruby1.9.2/bin/rake:31:in `<main>'
jason@jason-VirtualBox:~/work/depot$ rake db:migrate
(in /home/jason/work/depot)
我在heroku中访问我的应用程序,它显示错误:
应用程序错误
应用程序中发生错误,无法提供您的页面。请稍后再试。如果您是应用程序所有者,请查看日志以获取详细信息。
答案 0 :(得分:0)
尝试在gem文件中为生产环境添加pg gem并执行以下命令
$ bundle install --without production
由于Heroku使用Postgresql数据库,我们必须使用这种方式。希望能帮助你。