Install Gems from GitHub

I’ve seen a few people confused by this, and I was stumped back in the day SO:

FYI, if you want to install gems from GitHub you need to add it as a source!

How? Easy!

sudo gem sources -a http://gems.github.com

Now you can install any gem hosted on GitHub with something like:

sudo gem install yo-mama

One other thing to note. Gem names when installing from GitHub are formatted as: username-projectname

So if you were looking @ user “billybob” and he forked a gem/project called “fishface”… the way you install would be:

sudo gem install billybob-fishface