Tag Archives: merb

Freezing gems in your Merb application

We recently had a problem with an alpha version of a gem which, though useful, had a bug which involved editing the gem source while we waited for it to be fixed.    We decided the best way to do it was to fix it once, freeze the gem inside the application, and then check it in to git. Here’s the command, which should be run in the root of your app:

gem install /path/to/local/gem/cache.gem –no-ri –no-rdoc –ignore-dependencies -i gems

Where:

  • /path/to/local/gem/cache.gem is the path to your local copy of the gem in cache, for instance “/Library/Ruby/Gems/1.8/cache/watir-webdriver-0.0.9.gem”
  • –no-ri and –no-rdoc stop documentation being installed
  • –ignore-dependencies stops gem dependencies being installed at the same time
  • -i gems installs the gem into a subcirectory called “gems”