Open Ruby installed gems in editor

command lineruby

How to open installed gems in editor such Sublime Text or Text Mate or Atom?

I would like to do it from command line like:

open -a Sublime\ Text\ 2 something_here

Best Answer

If you use the Ruby that comes with 10.9, gems are installed in /Library/Ruby/Gems/2.0.0/:

open /Library/Ruby/Gems/2.0.0/gems/plist-3.1.0/lib/plist/parser.rb

If you use a Ruby installed with Homebrew, gems are installed in /usr/local/lib/ruby/gems/*/gems/.