heroku rake db:migrate
失败。
我跑heroku run:detached rake db:migrate
并查看日志。它如下:
2015-02-02T12:04:16.605084+00:00 heroku[run.3014]: Starting process with command `bundle exec rake db:migrate`
2015-02-02T12:04:17.308737+00:00 heroku[run.3014]: State changed from starting to up
2015-02-02T12:04:22.643322+00:00 app[run.3014]: rake aborted!
2015-02-02T12:04:22.643955+00:00 app[run.3014]: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
2015-02-02T12:04:22.643972+00:00 app[run.3014]: /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/railtie.rb:41:in `block (3 levels) in <class:Railtie>'
2015-02-02T12:04:22.643352+00:00 app[run.3014]: Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
2015-02-02T12:04:22.643957+00:00 app[run.3014]: /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/base.rb:316:in `<module:ActiveRecord>'
2015-02-02T12:04:22.643974+00:00 app[run.3014]: Tasks: TOP => db:migrate => db:load_config
2015-02-02T12:04:22.643944+00:00 app[run.3014]: /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/connection_specification.rb:174:in `spec'
...
我认为错误的原因是Gemfile。但是,有
group :production do
gem 'pg','0.15.1'
gem 'rails_12factor', '0.0.2'
end
在我的gemfile中。我该怎么办?
heroku run rake --trace db:migrate
的结果:
Running `rake --trace db:migrate` attached to terminal... up, run.8631
!
! Timeout awaiting dyno, see https://devcenter.heroku.com/articles/one-off-dynos#timeout-awaiting-process