News and Notes from the Makers of Nexus | Sonatype Blog

Rubyists Rejoice - Nexus Supports RubyGem Repositories

Written by Brian Fox | December 02, 2014

We have done it again! Our Nexus development team has been busy this fall. With Nexus 2.9 in September, we introduced NuGet support for Nexus Open Source. In October Nexus 2.10 introduced npm support for all Nexus editions. And now with Nexus 2.11, we are adding Ruby Gem Repository support!

We are happy to announce that Nexus 2.11 adds full support for Ruby Gem repositories to all Nexus editions including Nexus Open Source, Nexus Professional, and Nexus Professional CLM Edition.

Christian Meier, active JRuby committer and creator of the JRuby Maven plugin has maintained an open source project to support Gem repositories for Nexus with us for quite a while. However this integration was not part of a default Nexus install and users had to build and install the plugins themselves. To improve the experience for everyone, we have worked together to bring this capability into the main Nexus Open Source project and therefore into the default install of any Nexus edition. On the way the Nexus development team and Christian improved the codebase and solidified the features. Christian’s deep experience with Ruby and gems, helped ensure that we create the features needed to make Gem repository support in Nexus viable for real-world production use.

The new Gem repository support brings the tried and tested concepts used for Maven, NuGet and NPM repositories of combining proxy and hosted repositories in a group and exposing them to the client tools for Ruby, gem and Bundler users.

Proxy,

First create a proxy repository of the main RubyGems repository. This will allow you to take advantage of the proxy features of Nexus. Any gem downloaded by a users will be cached in Nexus and subsequent requests will no longer have to reach out to rubygems.org. This will reduce your bandwidth needs and make any gem install on subsequent systems more reliable and much faster, since the gem will be local on your network already. And you will have access to all the gems available at RubyGems.org and potentially any other gem repository you want to access without relying on the performance of that upstream repository for each request.

Host,

Then create a hosted repository for you own gems that you wish to distribute within your organization. This allows you to push a gem to Nexus and all other users can just install the gem on their system without any need for further custom tooling. A simple ‘gem install GEMNAME’ will do.

Optionally you can also create another hosted repository to host other gems, maybe from a proprietary vendor or partner organization, that doesn’t use Nexus yet.

Group,

Finally to make it super simple for your users, you create a Gem repository group. It merges the proxy and hosted repositories and exposes all the contents via one simple URL. This URL stays the same even if more gems are added to the repositories or if more proxy repositories are added to the group. Its truly a fire and forget configuration that just works.

And Enjoy!

Your users now have configure gem on their machine to use Nexus as a source. And if they want to push to Nexus they can use the nexus gem we provide.

All you have to do is get new Nexus 2.11 - Open Source or Professional, install it and get it configured and you are up and running. It will be quick and easy with the documentation and the benefits will be immediate. If you are using Ruby, If you are a Ruby developer, give it a try and let us know how you like it.