On Sunday, March 17, 2013 5:59:34 PM UTC, Ruby-Forum.com User wrote:
>
> Hello, 
>
> I would like to exactly know how rubygems-bundler and bundler make 
> difference in Rails applications. 
> I am using RVM to manage different Ruby versions and ruby gems. 
> When I have a look into @global gemset for each ruby version, I can see 
> four gems have been by default installed. (rvm, rubygems-bundler, 
> bundler and rake). 
>
> 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 solves 
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 and 
2.0 installed. If your app loads the foo gem first then the defaut will be 
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 the 
same gem. Of course if your app had loaded foo 1.x instead everything would 
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 the 
same versions of the gems (including your production development, makes it 
easy to install all an app's dependencies in one go and makes it very easy 
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 bundler 
to use, or rake might load a gem that clashes with something else in your 
app.  You can use `bundle exec rake` to load bundler first and ensure that 
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 
unnecessary.

Fred

> Thanks in advance. 
> Christopher 
>
> -- 
> Posted via http://www.ruby-forum.com/. 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/GOyMmGyFQaYJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to