Heading image for post: Using Github Repos in your Gemfile

Ruby

Using Github Repos in your Gemfile

Profile picture of Paul Elliott

There is always that one gem that you need to pull from a github repo. The author has slacked off on cutting a release for that bugfix that had you blocked and now you've got to not only type out the whole repo url but you have this monstrosity mixed into your beautiful Gemfile.

gem 'fabrication'
gem 'decent_exposure'
gem 'none_such', git: 'git://github.com/avdi/none_such.git'
gem 'quantum_leap'

Unfortunately you can't git rid of that ugliness completely, but you can make it a little more pleasant and easier to type by using the github option instead of git.

gem 'fabrication'
gem 'decent_exposure'
gem 'none_such', github: 'avdi/none_such'
gem 'quantum_leap'

The branch option still works like you would expect, so you can safely use the new syntax without losing functionality.

You must be on bundler 1.1 or newer to use this feature.

More posts about Ruby Development

  • Adobe logo
  • Barnes and noble logo
  • Aetna logo
  • Vanderbilt university logo
  • Ericsson logo

We're proud to have launched hundreds of products for clients such as LensRentals.com, Engine Yard, Verisign, ParkWhiz, and Regions Bank, to name a few.

Let's talk about your project