0
votes

I am in the process of building a simple Ruby on Rails with git and Heroku for version control and deployment. Here’s the basic outline that I’m using:

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

Everything looks like it’s going fine and then I get the following:

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:inspec'

Here’s what I’m using:

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

1 Answers

0
votes

Fixed by updating the gemfile with the following:

group :production do gem 'pg', '~> 0.20' gem 'rails_12factor' end