Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm using RVM, what is the difference between using bundle install and rvm bundle install?

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.

like image 807
LondonGuy Avatar asked Jun 29 '11 16:06

LondonGuy


People also ask

Is bundle the same as bundle install?

The commands bundle & bundle install also have the same functionality. bundle uses Thor, and bundle 's default task is install . Also, bundle i does the same thing as bundle install because bundle 's task i is mapped (aliased) to install .

What is the difference between bundle install and bundle update?

lock . In general, you should use bundle install(1) to install the same exact gems and versions across machines. You would use bundle update to explicitly update the version of a gem.

What is bundle install Ruby?

Bundler creates a small Ruby file (a binstub) that loads Bundler, runs the command, and puts it in bin/ . This lets you link the binstub inside of an application to the exact gem version the application needs. Creates a directory (defaults to ~/bin ) and places any executables from the gem there.

What is bundle install in rails?

$ bundle install. This will update all dependencies in your Gemfile to the latest versions that do not conflict with other dependencies.


1 Answers

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.

like image 162
ghoppe Avatar answered Nov 15 '22 15:11

ghoppe