Tuesday, March 27, 2012

Installing RubyGems in Cygwin

This is as much a reminder for myself as anything else – as I’ve now had to do this about a dozen times between repaving my laptop, home workstation, and work machine(s).

The How-To

Don't try to install RubyGems for Cygwin using the gem that comes with the Ruby One-Click Installer for Windows. Instead, get the tarball, or zip file, and install it using the included installer script.
Since RubyGems is pure Ruby you don't have to worry about having a compiler installed. It should just work with the default Cygwin install plus Ruby and its dependencies. To install it, do the following steps:
  1. Download the RubyGems tarball from Ruby Forge
  2. Unpack the tarball
  3. In a bash terminal, navigate to the unpacked directory
  4. Run the following command:
    ruby setup.rb install
  5. Update RubyGems by running the following:
    gem update --system
Note: You may need to run the updated command twice if you have any previously installed gems.


  1. I had to freshly install Compass and Susy today. I did not have a problem using the Ruby Gems Version that comes with Cygwin if you install Ruby via setup.exe. Everything worked.
    Now if this holds true, it would save us all quite some work, and nice work by the Cygwin team.

  2. Although this is an old post, it helped me a lot today, thank you for taking the time to write it.