Private Gem Server Using Geminabox
The Problem
At HealPay, we were starting to develop a lot of internal gems to handle the business logic of our applications separate from our web applications. We were also creating some re-usable code that we didn’t necessarily want to open source (at least yet). We needed something that could sustain our use of rubygems without us having to create a private rubygems server for gem distribution.
The Solution
Enter Gem in a Box - Really simple rubygem hosting. It lets you host your own gems, and push new gems to it just like with rubygems.org.
Gem in a Box includes a simple web app and command line client. The clean web interface lets you view your published gems and the command line comes bolted on when you install the gem. Pushing new changes for a gem are as easy as running this command:
To automate the task of pushing to my private gem server, I created a Rake task that has all of the standard gem building tasks but with the inabox command twist.
The HPGEMS_URL environment variable needs to be set on your servers (usually in your bashrc) to the url where you installed the geminabox server. Then you can simply add this to the Gemfile if your gems:
And example of the .bashrc file might look like this:
When you run bundle install on your gems, it will look for dependencies at rubygems.org and your private gem server.