Rubygems, RVM and Bundler Confustion

  • Thread starter lucky Developer
  • Start date
L

lucky Developer

I am really confused with how these three (rubygems, rvm and bundler)
work in isolation when we are installing gems. Please do not tell me how
you work :) :) that will help me but I won't learn what is exactly
happening when we play with rubygems, rvm and bundler.

My above single confusion can be broken down into these questions below.

1. When I just have rubygems (without rvm or bundler), and when i
install a gem, where is it getting installed ?
2. When rubygems + rvm is installed, and when i install a gem, where
is it getting installed ?
3. when rubygems + rvm + bundler is installed, and when i install a
gem, where is it getting installed?

Please help me understand this stuff. thanks a ton.
 
S

Steve Klabnik

[Note: parts of this message were removed to make it a legal post.]
1. When I just have rubygems (without rvm or bundler), and when i
install a gem, where is it getting installed ?

If you 'gem install', it gets installed to your home directory. If you 'sudo
gem install', it gets installed to a global directory, I don't quite
remember at the moment.

2. When rubygems + rvm is installed, and when i install a gem, where
is it getting installed ?

Into ~/.rvm/rubies/the_ruby_i'm_using/lib/ruby/gems/1.9/gems, or something
very similar.

3. when rubygems + rvm + bundler is installed, and when i install a
gem, where is it getting installed?

The same place. Bundler only automates which gems get installed, not where
they go.
 
L

lucky Developer

The same place. Bundler only automates which gems get installed, not
where
they go.

thanks. what about a directory called .bundle in our app's root folder.
what does it have and what role does it play ?
 
H

Hassan Schroeder

=A0 1. When I just have rubygems (without rvm or bundler), and when i
install a gem, where is it getting installed ?
=A0 2. When rubygems + rvm is installed, and when i install a gem, where
is it getting installed ?
=A0 3. when rubygems + rvm + bundler is installed, and when i install a
gem, where is it getting installed?

`gem env` will show you where things are getting installed (and a lot
more, actually).

You might also want to run `gem --help` to get more familiar with the
capabilities and options.

HTH,
--=20
Hassan Schroeder ------------------------ (e-mail address removed)
twitter: @hassan
 
S

Steve Klabnik

[Note: parts of this message were removed to make it a legal post.]
thanks. what about a directory called .bundle in our app's root folder.
what does it have and what role does it play ?


It contains a file, config, which is a YAML file that saves the options you
ran bundler with, that way they can become the default.

Sometimes, if you run certain commands, it can contain a cache of your gems.
But that's not usual.

Also, you'll want to put .bundle in your .gitignore, and Gemfile and
Gemfile.lock into your repository UNLESS you're developing a gem, in which
case, you just want the Gemfile. More here:
http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top