Setting up PostgreSQL 8.x with Ruby 1.8.6 on Rails 2.3.4
Nov0
PostgreSQL is a:
Sophisticated open-source Object-Relational DBMS supporting almost all SQL constructs, including subselects, transactions, and user-defined types etc…
The Problem
-
You have just installed PostgrelSQL.
-
You have generated your rails app
rails myApp -d postgresql
-
You try to run the server
ruby script/server
-
You add your DB details in config/database.yml and you notice this note.
On Windows:
# gem install ruby-postgres # Choose the win32 build. # Install PostgreSQL and put its /bin directory on your path.
-
Install that gem
gem install ruby-postgres
* I didn’t get prompted to choose the win32 build but it all installs well.
From now on, to cut this short, few of the errors that you might encounter:
Please install the postgres adapter: 'gem install activerecord-postgres-adapter'
if you try to install that gem you will get this Error
ERROR: could not find activerecord-postgres-adapter locally or in a repository
So try to install this gem instead “ruby-postgres” like i mentioned before.
Another prompt you might get is when trying to run the server:
The ordinal 284 could not be located in the dynamic link library SSLEAY32.dll
The Solution
-
Copy both “ssleay32.dll” and “libeay32.dll” from Postgresql bin directory. On my machine that’s:
C:\Program Files\PostgreSQL\8.4\bin
-
and put them in Ruby’s bind directory. On my machine that’s:
C:\Ruby\bin
- And it works!
* It seems those files were already in Ruby’s bin folder, so overwrite the ones there.
Enjoy this article?
Consider subscribing to our RSS feed!
// No Comments
No comments yet.

