On Sunday, March 17, 2013 5:59:34 PM UTC, Ruby-Forum.com User wrote:
I am confused by Rubygems, bundler and rubygems-bundler.
Can anyone kindly walk me through the differences between them?
rubygems is the now standard way of packaging and distributing ruby
libraries. bundler is a gem to handle dependency management. It also
dependency mismatch problems that used to occur.
Say for example that your app uses the foo gem (any version) and the bar
gem. The bar gem is only compatible with foo 1.x, but you have foo 1.x
2.0 installed. If your app loads the foo gem first then the defaut will
the latest version (2.0), but this will then prevent you loading the bar
gem, because it can only use foo 1.x and you can’t load 2 versions of
same gem. Of course if your app had loaded foo 1.x instead everything
be fine but before bundler there was no easy way of managing this .
bundler also helps ensure that everyone working on a project is using
same versions of the gems (including your production development, makes
easy to install all an app’s dependencies in one go and makes it very
to install gems straight from their git repo.
A minor annoyance with bundler is that it means that you might run into
problems running (for example) rake: this would load the most recent
version of rake, which might clash with the version you have asked
to use, or rake might load a gem that clashes with something else in
app. You can use
bundle exec rake to load bundler first and ensure
these problems don’t happen, but it gets a bit annoying to have to type
that extra preamble everytime. rubygems-bundler aims to make that