运行:rake资产:预编译,rake aborting

时间:2018-02-12 22:10:22

标签: ruby-on-rails git rake heroku-cli

我正在使用git和Heroku构建一个简单的Ruby on Rails来进行版本控制和部署。这是我正在使用的基本大纲:

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 spec'

以下是我正在使用的内容:

ruby 2.4.3p205 (2017-12-14 revision 61247) [x64-mingw32]
rails 5.1.4

1 个答案:

答案 0 :(得分:0)

通过使用以下内容更新gemfile来解决此问题:

组:生产做   宝石'','〜> 0.20'   gem' rails_12factor' 端