Setting Up Postgresql with Rails on Windows
Switching over to Postgresql for a Ruby on Rails application on a Windows machine is pretty simple.
- Download Postgresql and install it
- Install postgres-pr in the Ruby console with: gem install postgres-pr
- Add Postgresql’s /bin path to your PATH environment variable in Windows. Do this by going to:
Start->Control Panel->System->Advanced->Environment Variables->Select PATH->Click Edit
Add the full path to the Postgresql bin directory to the end. What you append should look something like
;C:\Program Files\PostgreSQL\8.4\bin
- Edit your /config/database.yml file to use the Postgresql database. It should look something like
development:
adapter: postgresql
database: DATABASENAME
username: YOURUSERNAME
password: YOURPASSWORD
host: localhost
encoding: UTF8 - Run your migrations
rake db:migrate
You’re done! Wasn’t so bad, was it?
[via Sensorial'Org]

