1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Faster and Reproducible Ruby Development Workflows

Posted at

Originally posted in http://aespinosa.github.io/blog/2015-05-16-fast-and-reproducible-ruby-workflows.html

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"
syndrome.

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

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

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

Remote URL: https://rubygems.org

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

---
:sources:
- http://127.0.0.1:8081/nexus/content/repositories/rubygems/

And ~/.bundle/config

---
BUNDLE_MIRROR__HTTPS://RUBYGEMS__ORG/: http://nexus.dev:8081/nexus/content/repositories/rubygems/

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
less.

  1. http://books.sonatype.com/nexus-book/reference/ruby-proxying-registries.html

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?