Sunday, March 1, 2009

Heroku gem deployment last resort

If you're having problems installing a gem in your heroku app, check this out as a last resort:

Here's the workaround (commands in bold):
1.) Get a local copy of your app by using the export option on heroku.
2.) Unpack it to a local folder and open up a command line/shell/command prompt.
3.) cd to your app's directory
4.) gem install gemsonrails to get gemsonrails installed to your local gem repo
5.) gemsonrails to install some gemsonrails helpers to your app's environment
5.) rake gems:install GEM=gem_you_want -> gets your gem from the gem cloud in the sky and places it in vendor/gems
6.) rake gems:freeze GEM=gem_you_want -> gets your gem ready for primetime
7.) tar czf myapp.tar.gz myapp/
8.) upload the tar.gz to heroku
9.) sigh with relief because you can now use your favorite gem.

No comments:

Post a Comment