HowTo: Install Rails in Cygwin

Steps

  1. Install Cygwin
  2. Install Ruby Gems
  3. Install Rails
  4. Install the Database Adapter

Install Cygwin

Using Cygwin’s setup.exe, choose Ruby and sqlite3 under Dev. It is useful to have a version control system in place, so I recommend choosing subversion and git.

If you need MySQL connection for Rails, you need to install gcc also. You will need it to build the Cygwin version of MySQL, which is needed for the Ruby adapter.

Install Ruby Gems

Download Ruby Gems from this link. Make sure you do not have the “RUBYOPT” environment set. If you have a previous installation of Ruby you might have this set in your environment. Unset it. Unzip ruby gems, then run setup.rb.

ruby setup.rb

Install Rails

gem install rails

This will install rails, including the ri and rdoc documentation.

Install the database adapter

To install the sqlite3 adapter,

gem install sqlite3-ruby

To install MySQL support, you need to download the MySQL generic source package and build it. Extract the tarball into a temporary directory, cd to that directory, and then

./configure
make install

Building will take some time. After a successful build,

gem install mysql

If you are prompted for a choice choose the latest ruby version.

Follow

Get every new post delivered to your Inbox.