Where are my ruby gems?

RubyLinuxGem

Ruby Problem Overview


Linux newbie question I guess..

How can I find out where gem installs the gems on my Ubuntu 10 system? I want to read gem sourcecode and perhaps change things up a bit.

Ruby Solutions


Solution 1 - Ruby

Running gem environment should give you a fair bit of information about your RubyGems installation. The field you're looking for is 'INSTALLATION DIRECTORY'.

That said, if you want to modify some gems, there may be better ways to go about it. Most gems, for example, are hosted on github.com. If you make a fork there and make any improvements, you can submit them back to the maintainer in the form of pull requests. Most developers are happy to accept patches (that's why they're on github, right?), and you get a warm fuzzy for making the world a slightly better place for everybody else using that gem.

Solution 2 - Ruby

From your application directory you can run bundle show rails to reveal the path of a specific gem.

Jump to the directory like this

cd `bundle show rails`

Quickly open a gem in Sublime

subl `bundle show rails`

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionscrrrView Question on Stackoverflow
Solution 1 - RubyJohn HylandView Answer on Stackoverflow
Solution 2 - RubyjohnnyView Answer on Stackoverflow