Installing and Configuring Ruby 1.9 from Source Using Cygwin
If you are developing Ruby on Rails apps on Windows then chances are you will want to use Cygwin. Cygwin provides a Unix like shell on top of the Win32 API so you can follow tutorials and easily use utilities like SSH and Git. If you are planning to use Ruby 1.8.7 then installation is easy, you can just select the package from the Cygwin setup and voila.
If however you want to use Ruby 1.9 you will have to compile it from source from within Cygwin. There are a few ‘gotchas’ so here is how to do it.
First off you will need to install a few development libraries into your Unix environment. You will need to default selected configuration + ‘make’ + ‘gcc’ + ‘libiconv’ + ‘openssl’. You install these by selecting them in the Cygwin setup UI (you can use the search or navigate the tree structure) and installing directly from there.
Next you will need to download the Ruby 1.9 source (ruby-1.9.1-p378.tar.gz in my case but the build number will vary depending on when you are reading this) from http://ruby-lang.org/ into your home directory.
You can then ‘tar xvf ruby-1.9.1-p378.tar.gz’ to unzip the files.
cd ruby-1.9.1-p378 and issue a ‘. / configure’
(Note: this takes 15 minutes or so as it checks and configures a lot of things)
When this has completed you issue a ‘make’ command
When this is complete you issue a ‘make install’ command
When this is complete you can test the installation with a ‘ruby –v’ command
Voila! Next post will cover installing Rails under Cygwin.


Pingback: Ruby on Rails in Cygwin « f i c i a l
Pingback: Windows Mac-alike Rails Development Environment | Mehigh