There are times you would like to run your own gem server. You may want to
share gems with colleagues when you are both without internet connectivity. You
may have private code, internal to your organization, that you’d like to
distribute and manage as gems without making the source publicly available.

There are a few options to set up a server to host gems from within your
organization. This guide covers the gem server command and the Gem in a
Box project. It also discusses how to
use these servers as gem sources during development.

Running the built-in gem server

When you install RubyGems, it adds the gem server command to your system.
This is the fastest way to start hosting gems. Just run the command:

gem server

This will serve all your installed gems from your local machine at
http://localhost:8808. If you visit this url in your
browser, you’ll find that the gem server command provides an HTML
documentation index.

When you install new gems, they are automatically available through the
built-in gem server.

For a complete list of options, run:

gem server --help

Among other options, you can change the port that gems are served on and
specify the directories to search for installed gems.

Running Gem in a Box

For a server with more features, including the ability to push gems, try out
the Gem in a Box project.

If you’re using Bundler then you can specify this
server as a gem source in your Gemfile:

[~/dev/myapp] cat Gemfile
source "http://localhost:9292"
gem "secretgem"
[~/dev/myapp] bundle
Using secretgem (0.0.1)
Using bundler (1.0.13)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

RubyGems.org is the Ruby community’s gem hosting service. Instantly publish your gems and install them. Use the API to interact and find out more information about available gems. Become a contributor and enhance the site with your own changes.