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

27,345

Solution 1

make sure your db-adapter in database.yml is set to "postgresql". If still you have the same problem, then try using the pure-ruby adapter:

gem install postgres-pr

(make sure you uninstall the pg gem before... to avoid conflicts)

If it works, then it's a problem with the postgres gem. Anyway, for development purposes, using the pure-ruby gem is usually ok.

Solution 2

I had more luck with the ruby-pg gem

gem install ruby-pg

I tried a number of the other gems 'postgres', 'pg', 'postgres-pr' with no luck My environment was Ubuntu 10.4, ruby enterprise 1.8.7

ruby-pg resolved the above issue for me

Solution 3

for debian squeeze it is:

aptitude install libdbd-pg-ruby

Solution 4

Similar (almost identical) errors can arise in Rails 3.0.4 with Postgres and pg, when you mistype the adapter name in your database.yml, for instance "postrgesql" instead of "postgresql":

Please install the postrgesql adapter: gem install activerecord-postrgesql-adapter (no such file to load -- active_record/connection_adapters/postrgesql_adapter)

Solution 5

gem install postgres-pr

worked for me on Windows 7 with Rails 2.3.4

Share:
27,345
silent1mezzo
Author by

silent1mezzo

I'm a django/python developer.

Updated on December 10, 2020

Comments

  • silent1mezzo
    silent1mezzo over 3 years

    Possible Duplicate:
    How to handle Ruby on Rails error: “Please install the postgresql adapter: `gem install activerecord-postgresql-adapter'”

    I'm trying to get Redmine working with postgres.

    In my logs I keep seeing.

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

    After googling everyone said you needed to do gem install pg. But when I do gem list

    actionmailer (2.3.5)
    actionpack (2.3.5)
    activerecord (2.3.8, 2.3.5)
    activeresource (2.3.5)
    activesupport (2.3.8, 2.3.5)
    fastthread (1.0.7)
    passenger (2.2.15)
    pg (0.9.0)
    postgres (0.7.9.2008.01.28)
    postgres-pr (0.6.3)
    rack (1.0.1)
    rails (2.3.5)
    rake (0.8.7)
    

    You can clearly see that pg is already installed. Has anyone else found this issue or fixed it?