Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle Ruby on Rails error: "Please install the postgresql adapter: `gem install activerecord-postgresql-adapter'"

Running a Ruby on Rails (RoR) app or Ruby code which uses the ActiveRecord framework, you get the error message:

Please install the postgresql adapter: gem install activerecord-postgresql-adapter

Trying to run:

gem install activerecord-postgresql-adapter 

also fails, leaving you at a loss.

like image 603
user71268 Avatar asked Nov 02 '09 23:11

user71268


1 Answers

The problem is not what anyone wrote. The problem is that the name of the postgresql database adapter is "postgresql", not "postgres", though the name of the GEM is "pg".

The definition in the database.yml file should include

  adapter: postgresql 
like image 82
mcr Avatar answered Sep 20 '22 07:09

mcr