When using postgresql as database, the gem pg is added to the Gemfile. After running bundle install and rails s the following error occurs:
/home/andres/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/connection_specification.rb:188:in `rescue in spec': Specified 'postgre
sql' 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). (Gem::LoadError)
If I specify the version 1.0.0 the error still ocurrs. If I specify the gem version as 0.20, the error disapears. The manual fix is easy, but I think the generator should include the 0.20 version in the Gemfile. The error may be caussed by the 1.0.0 version of pg (found this issue). I'm using Rails 5.1.4, ruby 2.3.1 and Postgres 9.4.8 in Ubuntu 16.04.
The problem appears to be fixed in rails 5.1.5.rc1, but I think that it is a better practice to specify explicitly a version for each gem, as some updates may break the setup (as it happened with the pg gem).
When using
postgresql
as database, the gempg
is added to theGemfile
. After runningbundle install
andrails s
the following error occurs:If I specify the version
1.0.0
the error still ocurrs. If I specify the gem version as0.20
, the error disapears. The manual fix is easy, but I think the generator should include the0.20
version in theGemfile
. The error may be caussed by the1.0.0
version ofpg
(found this issue). I'm usingRails 5.1.4
,ruby 2.3.1
andPostgres 9.4.8
in Ubuntu 16.04.