views:

26

answers:

1

I'm using Rails 3.0.1. I installed the native pg gem for postgresql with this command:

$ export ARCHFLAGS='-arch i386' $ sudo gem install pg -- --with-pg-config=/Library/PostgreSQL/8.4/bin/pg_config

When I run the gem list, I can see that pg 0.9 is installed.

However when I set the postgres database adaptor and re-run the server, I get this error:

no such file to load -- pg

How can I fix this?

Thank you

+2  A: 

Open the file named "Gemfile" in the root of your project and add:

gem 'pg'

somewhere in the middle of it (mine is after the line "gem 'rails', '3.0.0'").

Another way to "fix" it is to create new project with:

rails new <project_name> -d postgresql
Milen A. Radev
Thank you so much! I've spent an entire week looking for the solution.
Alex