3

I have been pulling out my hair trying to get this to work. Any experience or info would be very appreciated.

When trying to recompile Rails 3.1 assets locally (before I push to Heroku) I get the error:

rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
rake aborted!
Please install the pg adapter: `gem install activerecord-pg-adapter'
(no such file to load --active_record/connection_adapters/pg_adapter)

Then when I go to install the gem I get an error:

Could not find a valid gem 'activerecord-postgresql-adapter' (>= 0) in any repository

Any help greatly appreciated, this is causing me gray hairs.

Alekx
  • 891
  • 1
  • 11
  • 19

1 Answers1

2

Looks like this answer may help:

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

It looks like the gem is called "pg", so: gem install pg

You may also want to check your database.yml file, as the first answer in the linked post suggests.

Community
  • 1
  • 1
Justin
  • 1,203
  • 8
  • 15
  • I saw that too, and when I run with the suggested changes, I get rake assets:precompile --trace ** Invoke assets:precompile (first_time) ** Execute assets:precompile rake aborted! could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"? Tasks: TOP => environment – Alekx Nov 04 '11 at 04:09
  • postgresql isn't my strong point, so hopefully someone will chime in at this point. Did you check that /var/pgsql_socket.s.PGSQL.5432 exists? Have your tried connecting to it outside of rails? Is it chowned by the same user that is running rake? – Justin Nov 04 '11 at 05:47