Thursday, September 20, 2012

Cygwin and Ruby

When developing on Windows, I don't truly feel at home until I install cygwin.  I don't know how I'd live without the great command line tools like grep, less, vi, find, wc, diff, the list goes on and on.  Sure I could find Windows equivalent and dl them all, but cygwin gives it all to me right away in one place.

So when developing in Ruby, I wanted something compatible with cygwin.  I had previously installed Ruby in Windows and relied on cygwin finding the Ruby executable when I ran my Ruby code.  This is fine for just using Ruby, but when I wanted gem and irb, I was SOL.  I had to install from source.  Luckily, this was super easy:

  1. Using the cygwin setup, install make, gcc, libiconv, openssl, libyaml-devel, zlib, zlib_devel and wget.
  2. Then navigate to and grab the url for the source of ruby that you want to install and wget it.
    1. wget
  3. Then untar it and cd into the ruby* directory
  4. Run ./configure
  5. Run ./make
  6. Run ./make install
  7. Then test it!  
    1. which ruby and it should be something like /usr/local/bin/ruby
Now you have ruby, gem, irb and all the rest.

No comments: