views:

92

answers:

2

Hello, I'm pretty new to Ruby/Rails but I was taking a look at bundler and was wondering how it works exactly. Do you install a full set of gems like normal gem install XYZand then use the Gemfile to pull a certain subset of those gems for use with a specific application? Or do you not install gems normally anymore and just include them in the Gemfile and then do a bundle install to include them all in a bundle that is then used with your application?

Thank you so much for taking the time to answer this, I'm just a little confused on what bundler's functionality is exactly.

-- MAP

+1  A: 

Think of bundler as a package management tool.

From bundle help command:

bundle install # Install the current environment to the system

bundle package # Locks and then caches all of the gems into vendor/cache

So bundle install command will install all gems to the system that are listed in Gemfile as well as their dependencies. If the gem was not previously installed it will grab it from the gemcutter repo. bundle package will cache the .gem files into your apps vendor/cache directory.

No need to run gem install first.

Poor Lil Rich Boy
I know we're not supposed to ask follow ups on on stackoverflow (according to the FAQ) but I have an extended question to this. What I'm really trying to do is manage multiple rails and ruby versions on one machine. So would I use RVM's gemsets for that and then use bundler as part of every RVM gemset I create in order to switch gemsets and with them rails versions?
MAP
A: 

Here's a screencast on bundler at railscasts.com

Pran