Запуск: активы рейка: прекомпиляция, прерывание рейка
Я нахожусь в процессе создания простого Ruby on Rails с git и Heroku для контроля версий и развертывания. Вот основная схема, которую я использую:
rails ne test_app
cd test_app
git add .
git commit -, “initial install”
heroku create
I modify the gemfile to get the sql out of production
I add gem pg to production
bundle install
rails generate test_app (with credentials)
git add .
git commit -m “updated”
git push heroku master
Все выглядит так, как будто все идет хорошо, и тогда я получаю следующее:
remote: -----> Installing node-v6.11.1-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: rake aborted!
remote: 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).
remote: /tmp/build_cfee4fae63659bd06c3737f67849dc42/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/connection_specification.rb:188:in rescue in spec'
remote: /tmp/build_cfee4fae63659bd06c3737f67849dc42/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/connection_specification.rb:185:in
спецификации"
Вот что я использую:
ruby 2.4.3p205 (2017-12-14 revision 61247) [x64-mingw32]
rails 5.1.4
1 ответ
Исправлено путем обновления gemfile следующим:
group: production do gem 'pg', '~> 0,20' gem 'rails_12factor' end