0

I'm using Ruby on Rails ( rails version 2.3.4), and using pg gem (version 0.12.2) on Windows. My database.yml file has the following content:

production:
  adapter: postgresql
  encoding: utf8
  host: localhost
  database: canvas4
  username: canvas
  password: canvas
  port: 5433
  timeout: 5000
  pool: 5
  queue:
    adapter: postgresql
    encoding: utf8
    database: canvas4_queue
    host: localhost
    port: 5433
    username: canvas
    password: canvas
    timeout: 5000
    pool: 5

But when i run command: bundle exec rake db:initial_setup RAILS_ENV=production, the error occurs:

Invalid connection "adapter"

I've also tried with gem "activerecord-postgresql-adapter" but the same error occurs as above.

I can successfully setup with sqlite3 driver.

Do you know how to get postgresql adapter to work with rails 2.3 ?

1 Answer 1

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.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.