-
Notifications
You must be signed in to change notification settings - Fork 7
Proxy
Nexus allows to run a proxy of a rubygems repository like rubygems.org. it is caching proxy and it continues to serve files even if upstream is down (default configuration).
just login into nexus, i.e.
http://localhost:8081/nexus
go to repositories and add a proxy repository and choose as provider 'Rubygems'. then add the url of the original rubygems repository. ndle install` but uses the mirror uri as configured.
it depends on your internet connection but sometimes the gem command gets a read timeout because the proxy takes it time to download the resource and it does not stream partial downloads.
first you add your proxy to the [sources for rubygems](Rubygems setup) and then remove the origin of the proxy (i.e. rubygems.org)
gem sources --add http://localhost:8081/nexus/content/repositories/rubygems/
gem sources --remove http://rubygems.org/
this nexus ruby repository is a caching proxy. some files changes on rubygems.org do change frequently ( almost on every minute base ). with nexus you can setup the expiration time of those metadata files so nexus updates them let's say every hour. or you just keep the default expiration and add a scheduled task Syncronize Rubygems Metadata Files every hour (or as often you feel it is needed). the advantage it that the update is done in the background and the ruby client using the repository does not need to wait for remote updates of those files.
for the bundler-API there also a schedule tasks to keep the cached dependencies up to date (Update Bundler Depedencies - see also the bundler section ).