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.

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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
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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.