Ruby dependency manager. Uses Gemfiles. gem install bundler
. Example of Gemfile:
source 'https://rubygems.org
gem 'nokogiri'
gem 'rack', '~>1.1'
gem 'rspec', :require => 'spec'
Then inside app, require 'rubygems'
and require 'bundler/setup'
bundle exec
runs an executable that comes with a gem in your bundle--deployment
, it installs unique to the app (defaults to vender/cache
)bundle show <gemname>
source 'https://rubygems.org'
defines which upstream to pull gems from.
Gemfile.lock
makes your application a single package of both your own and third-party codebundle install
-- source
Installs gems specified in the Gemfile.
Gemfile.lock
does not exist, Bundler will fetch all remotes sources and resolve dependencies, installing needed gemsGemfile
is unchanged, Bundler fetches all remote sources and uses dependencies specified in Gemfile.lock
Gemfile.lock
exists, and Gemfile
is changed, Gemfile.lock
is used for all unchanged gems, and will re-resolve the dependencies of gems that you did updatesudo bundle install
, several steps are user dependentAs safety, bundler will not automatically update a gem whose dependency versions conflict with the Gemfile.lock
. This means if gem A and B depend of C, when A is updated, requiring a new version of C, B will never break from this, at worst failing loudly.
bundle install
, which guarantees unchanged gems will remain untouched by the systembundle update <gemname>
if bundle install
cannot update itbundle install
bundle
call
on objectinstall_from_spec
a cache for remote servers (including rubygems.org) and a private gem source. By default, it is a local cache.
# Tell Bundler that you want Gemstash to find gems:
bundle config mirror.https://rubygems.org http://localhost:9292
# set Bundler to fallback to rubygems.org
bundle config mirror.https://rubygems.org.fallback_timeout true
bundle config mirror.https://rubygems.org.fallback_timeout 3
Gemstash lives is ~/.gemstash
, stores cached & private gems
Another gem caching solution, older than gemstash, more of a gem server than a cache. Uses gemirro, as a dependency for creating a RubyGems mirror.