Tuesday, June 28, 2011

Local gem referenced in Gemfile

When using the ubiquitous 'bundler' gem, you place references to the gems required for a package in the Gemfile which is used to load and automatically ensure the version control and requiring of libraries proceeds smoothly.  In actuality, it almost takes away your pain.  The one feature I wish it had is a parser that adds the version you are using and the gems you are calling and could add them to the Gemfile itself.  That would be a slick feature.

Anyway, the question I have this morning is how to reference a locally generated/installed gem.  Since most of the bundler functionality relies upon querying online repositories of gems like git, rubygems, ...

The solution is relatively simple.  You provide a path which contains a valid .gemspec.  Or, you can also explicitly specify the version of a .gem file for which to look.  http://gembundler.com/man/gemfile.5.html

Here is what I used:
gem 'isoelectric_calc_and_hist', '= 0.0.1',
:path => "/home/ryanmt/Dropbox/coding/isoelectric_calc_and_hist/"

No comments:

Post a Comment