Viewing a Gem's Source Code

Solution 1:

gem has an unpack command: http://guides.rubygems.org/command-reference/#gem-unpack

gem unpack rake
ls rake-0.4.3/

Solution 2:

There are two really good ways to do this. There is another gem which allows you to open the gem and edit. This gem is call gem-open

gem install gem-open 

then

gem open sass

Another way is to generate your own rdocs.

gem rdoc sass

You can then look at your rdocs by

gem server

Also if you are using rvm, you can type rvm info and it will show GEM_HOME location. This will be where all your gems source code is.

cd $GEM_HOME
cd gems/sass-3.1.2/

Update:

This is the way I mostly do this now, when using bundler.

cd $(bundle show sass) 

This will be the version of sass in your Gemfile.