# How to get some gem source code?

**URL:** <https://www.ruby-forum.com/t/how-to-get-some-gem-source-code/152472>\
**Category:** Ruby\
**Created:** [November 4, 2008, 11:30am UTC](https://www.ruby-forum.com/t/how-to-get-some-gem-source-code/152472 "2008-11-04T11:30:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubyernewbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Post date:** [November 4, 2008, 11:30am UTC](https://www.ruby-forum.com/t/how-to-get-some-gem-source-code/152472/1 "2008-11-04T11:30:44Z")

</div>

I gem install someone so can use the someone, but how I read the someone  
source code?

---

<div class="post-metadata">

**Author:** ![rubyernewbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Post date:** [November 4, 2008, 12:50pm UTC](https://www.ruby-forum.com/t/how-to-get-some-gem-source-code/152472/2 "2008-11-04T12:50:34Z")

</div>

Zhenning G. wrote:

> I gem install someone so can use the someone, but how I read the someone  
> source code?

The simplest way is just to look at the installed lib files. Look in  
ruby/lib/gems/1.8/gems/name\_of\_gem/lib. Where exactly your ruby/lib  
directory is will depend on your OS, but maybe something like  
C:/ruby/lib on Windows, or /usr/lib, /usr/local/lib or /opt/lib on  
Unix-ish systems.

Most gem-based software is open-source, so you should be able to find  
the code on wherever the project is hosted. Find out the project’s  
homepage (often on Rubyforge) and go to ‘Files’ or ‘Download’. Good  
projects will offer their code as a zip or .tar.gz download.

A .gem file is just a .zip file, so you can also unzip it and look  
inside for the source code.

a
