Gem::LoadError: can't activate pg (~> 0.18), already activated pg-1.0.0 [duplicate]

looks like pg 1.0 is not compatible with rails 5.1.4 at the moment.

gem 'pg', '~> 0.18'

0.18 worked for me.


Turns out the postgres gem version 1.0.0 is not compatible with Rails 5.1.4. When I changed the postgres gem version to '~> 0.18', everything worked fine:

Changed from:

gem 'pg' # Defaults to latest version 1.0.0 (not compatible with Rails 5.1.4).

Changed to:

gem 'pg', '~> 0.18'