Installing Ruby 1.9.1, Rails 2.3.2 and PostgreSQL on Windows Vista

This is a short write up on how I installed my Rails development environment on Windows Vista. If you have any trouble, consult the notes section at the bottom.

Update: I missed the part about installing the devkit, thanks to Roger Pack on the Rubyinstaller-devel mailing list. I also added a section for references.

Downloads

You’ll need to download the following:

Installing PostgreSQL 8.4

Installing PostgreSQL is rather simple, just follow the wizard.

PostgreSQL 8.4 Installer Welcome Choose your installation directory

Choose your data directory Configure service account password Configure listen port Setup default locale Installing PostgreSQL 8.4 Initializing the database cluster Installation success

Installing Ruby 1.9.1

Ruby 1.9.1 preview installer welcome GPL License Installation directory Installing Ruby 1.9.1 installation success

Installing the devkit

Extract “devkit041109.7z” to your ruby path, “C:\Ruby19”, after which you should have the following directory:

  • C:\Ruby19\devkit

Also, edit the file “C:\Ruby19\devkit\msys\1.0.11\etc\fstab” to contain the following:

C:/Ruby19/devkit/gcc/3.4.5 /mingw
C:/Ruby19/devkit/msys/1.0.11/usr/local /usr/local

Installing Rails and the pg gem.

The Ruby installer added a “Start Command Prompt with Ruby” to the Start Menu, go ahead and run that now.

  1. Add the PostgreSQL bin directory to your path.
  2. Install rails.
  3. Install the pg gem.
set Path=%Path%;C:\Program Files\PostgreSQL\8.4\bin
gem install --no-ri --no-rdoc rails
gem install --no-ri --no-rdoc pg

rails_pg_step01_to_step03


That’s it, go develop that killer twitter client, its what all the cool kids are doing.

Notes

  • If you had previously installed PostgreSQL, remove the service account user with “net user postgres /delete”.
  • Copy “C:\Program Files\PostgreSQL\8.4\bin\libeay32.dll” to “C:\Ruby19\bin” if you encounter an error when Rails attempts to connect to your database.

References