0

I have installed all the gems that I saw listed in How to handle Ruby on Rails error: "Please install the postgresql adapter: `gem install activerecord-postgresql-adapter'" - none of them work. It doesn't matter if I have postgres or postgresql in my databases.yml file.

I have no clue what I am doing wrong (I also installed the driver mentioned in the error as well. I keep getting that error.

/var/lib/gems/1.8/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:147:in `gem': Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.) 

I am trying to run "rails server webrick -p 80 -e production"

production:
  adapter: postgresql
  encoding: unicode
  database: imentor
  pool: 5
  username: postgres
  password: 
  host: localhost
  port: 5432

My problem was that I didn't actually know where to edit the gemfile ( (looked at the wrong gem file originally)

adding "gem 'pg'" to the Gemfile fixed it. Thanks to 'mu is too short'

Community
  • 1
  • 1
StanM
  • 827
  • 4
  • 12
  • 33

3 Answers3

1

My problem was that I didn't actually know where to edit the gemfile (looked at the wrong gem file originally)

adding "gem 'pg'" to the Gemfile fixed it. Thanks to 'mu is too short'

StanM
  • 827
  • 4
  • 12
  • 33
1

On ubuntu I just do

apt-get install libpgsql-ruby
0

I ran into a problem like this a few weeks back. I think you should try adding this code to the boot.rb file at first.

require 'yaml'
YAML::ENGINE.yamler = 'syck'

You should also try addding this to the grmfile and run a bundle install right after

gem 'pg'

If it helps also this is a sample of my database.yml file. Hope it works!

production:
  adapter: postgresql
  encoding: unicode
  database: dezirus
  username: postgres
  password: 
  • wouldn't it complain about not being able to parse or something related to yaml? This is also a brand new installation of everything, so there wouldn't be any problems with legacy code (which I think is where the yaml problems may come in) – StanM Sep 03 '12 at 01:04