Last Updated: February 25, 2016
· aespinosa

Faster and Reproducible Ruby Development Workflows

Originally posted in

If you're doing development and cloning ruby based repositories, sometimes you
want to cleanup your ruby gems spec or vendor/bundle directory. It is important
to do a clean 'bundle install' so you won't experience "it works on my machine"

However, downloading gems from all the time is not the best
experience in the world if you have a large Gemfile or is down

Java developers have had this feature in maven with 'proxy repositories'.
Fortunately, you can do this same thing with Sonatype
. Following the described documentation on
proxy gem repositories^1, Have something like this configured for

Repository ID: rubygems
Repository Name:
Repository Type: proxy
Repository Policy: undefined
Repository Format: rubygems
Contained in groups: 

Remote URL:

Likewise, you can have this in your ~/.gemrc


And ~/.bundle/config


Now, all gem downloads will be cached in nexus. The next time you do a 'git
clean -fdx && bundle install', you don't have to wait to download the Internet
to get your Ruby builds working. This setup is useful especially for CI servers
like Jenkins so that the next subsequent build times will be siginificantly