Installing private RubyGems

Once you have signed up for a Gemfury account and uploaded a few Gems, you can install them via the command-line, or with a Bundler Gemfile.

Your RubyGems server

The Repo URL is the RubyGems endpoint for your Gemfury account. To retrieve this URL, follow these steps:

  1. Go to your dashboard

  2. Select the Get Started tab and then RubyGems

  3. Get the Repo URL of the format

     https://gem.fury.io/ACCOUNT/
    
  4. Generate a deploy token for private access

Install RubyGems with a Gemfile

Using private Gems with Bundler is easy, just add a source block with your Gemfury Repo-URL to your Gemfile and enclose your private package requirements:

source 'https://gem.fury.io/ACCOUNT/' do
  gem 'private-gem', '~> 1.0'
end

You can also configure the source for individual packages with:

gem 'private-gem', source: 'https://gem.fury.io/ACCOUNT/'

And then run bundle install as usual.

Authenticating Bundler for private gems

To access private gems, you will need to authenticate using a deploy token. You can do this with Bundler configuration or through an environment variable.

It’s important to keep your Gemfury credentials out of your source code, particularly your Gemfile and Gemfile.lock files. Furthermore, we encourage each developer to use their individual credentials to access shared accounts.

When specifying your Repo-URL in your Gemfile, don’t explicitly place your access token in the source code. Instead, use the public URL format as shown in the Gemfile section above.

The authentication format uses USER:TOKEN where USER is the token assignee’s username and TOKEN is the deploy token value.

Local development

For local development, we recommend saving credentials to your Bundler config with:

bundle config gem.fury.io USER:TOKEN
Builds and deployment

For builds and deployment, you may configure authentication through the environment:

export BUNDLE_GEM__FURY__IO=USER:TOKEN

In both cases, Bundler will automatically apply these credentials to your Gemfury source declarations.

Install RubyGems with command-line

To use Gemfury with the command line, add the Source URL to your .gemrc with this command:

$ gem sources -a https://USER:TOKEN@gem.fury.io/ACCOUNT/

Or, use it in a single install:

$ gem install my-gem --source https://USER:TOKEN@gem.fury.io/ACCOUNT/

Uploading packages using RubyGems CLI

Gemfury supports Gemcutter API for uploading RubyGems. You can push one to your account by running:

gem push PACKAGE_FILE --host https://USER:TOKEN@push.fury.io/ACCOUNT/

To separately store your credentials, add your push token to ~/.gem/credentials:

---
:fury_push_token: PUSHTOKEN

And use --key to reference the token from your command:

gem push PACKAGE_FILE --key fury_push_token --host https://push.fury.io/ACCOUNT/