7

I would like to know the difference?

I can run both and they install but what is the actual difference?

I'm doing a tutorial/screencast by michael hart and he uses bundle install, how does this differ from using rvm bundle install?

I also decided to try out a trial of the "rubymine" ide and I noticed after running bundle install in terminal then opening the ide it tells me I need to update some gems so I'm sure it doesn't install bundles in the same place.

I've loaded up an rvm project in it.

LondonGuy
  • 10,778
  • 11
  • 79
  • 151
  • I think you're confused. There is no `rvm bundle` command. `bundle` is the command you use after you install the bundler gem. – ghoppe Jun 29 '11 at 16:31

1 Answers1

15

I think from this question, that you've not quite grasped the difference between rvm and bundler and what exactly each does. I'll try and explain the difference.

RVM is an acronym for Ruby enVironment (Version) Manager. It's a set of command-line scripts to help "sandbox" ruby binaries and gems for a project or set of projects. This way if you have one project that requires Ruby 1.8 and another that uses Ruby 1.9, you can switch easily between the two ruby installations and avoid nasty incompatibilities or cumbersome configuration.

You can also install different gemsets with each ruby version, so if you need to develop some applications with Ruby on Rails 2.3 and some with 3.0, or if you want to try the new 3.1 prelease, you can do so without breaking other applications' dependencies.

Bundler is a ruby gem which, as the website says, manages an application's dependencies through its entire life across many machines systematically and repeatably.

Bundler makes it easy to copy one application's source from one machine to another and install all the gems and dependencies needed by that particular application quickly and (relatively) painlessly.

So I understand the confusion as there is a bit of overlap. RVM gemsets are similar to gem bundles. The difference is that bundler manages the gems and dependencies for a single application and across multiple machines. An rvm gemset is a sandbox that keeps a group of gems in one place, tied to a particular ruby installation on a single machine, sometimes used for multiple applications.

So to close, when you say you "loaded up an rvm project" in your IDE, that's not particularly true. RVM is a sandbox, not a framework.

ghoppe
  • 21,452
  • 3
  • 30
  • 21
  • Makes complete sense to me now. I was running both bundle install and rvm bundle install and that's where I become confused. – LondonGuy Jun 29 '11 at 17:55
  • Well, I'm still confused as to what you're saying, because if you type `rvm bundle install` in the command line, it will show an error, as there is no `rvm bundle` command. ;-) – ghoppe Jun 29 '11 at 18:22
  • I actually meant when I type rvm gem install GEMNAME.. it works. Also rvm gem list gives me a different gem list from when I type "gem list" – LondonGuy Jun 29 '11 at 19:31
  • Ok maybe I don't get it. After reading through again. When I run bundle install how does it know what app/project to install bundles for? Do I I need to run bundle install in terminal if bundle install runs in rubyme? – LondonGuy Jun 29 '11 at 19:49
  • 1
    Your dependencies are declared in a file named `Gemfile` in the root of your application folder. When you run `bundle install` (in the root of your application), Bundler goes through this file, installs the gems and dependencies, then writes a snapshot of the gems and versions that it installed to `Gemfile.lock`. This and more is all explained on the gembundler.com website. – ghoppe Jun 29 '11 at 21:33
  • I have zero experience with rubymine and can't speak to how it integrates with Bundler and rvm, which, I suspect, is why you're confusing me with this `rvm bundle install` command you keep speaking about, since I now suspect that is a rubymine menu command, not a command on the command line. – ghoppe Jun 29 '11 at 21:35
  • Sorry, it was my mistake, rvm bundle install causes an error. rvm gem install was what I meant. I wondered if it was different than using just bundle install or gem install but this is all explain and I've been reading up on some stuff. Thanks for your help. – LondonGuy Jun 29 '11 at 22:18