Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between bundle and gem install?

I am pretty sure this is a very basic question but as a RoR newbie I'd like to understand why sometimes I use bundle install (which from my undertanding install all Gems and their dependecies from Gemfile) and gem install [gemname]?

What are the fundamental differences between both and when would I favour gem install instead of bundle install?

Thanks! Rog

like image 885
Rog Avatar asked May 28 '11 13:05

Rog


People also ask

What is bundle in gem?

Bundler prevents dependencies and ensures that the gems you need are present in development, staging, and production. Starting work on a project is as simple as running the bundle install command.

What is a gem install?

gem install , in its simplest form, does something kind of like this. It grabs the gem and puts its files into a special directory on your system. You can see where gem install will install your gems if you run gem environment (look for the INSTALLATION DIRECTORY: line):

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 .

What is bundle installation?

bundle install is a command we use to install the dependencies specified in your Gemfile.


1 Answers

I'd say: by default on your local machine, no particular difference but...

The purpose of bundle install is to setup everything for the application containing the Gemfile. You can even pass arguments to make needed gems installed in whatever folder you want.

This way in production, you have clearly separated apps with their own gems.

On the other side, gem install gmaps4rails (easy advertisement) gets the gem installed for your whole environment.

like image 111
apneadiving Avatar answered Sep 23 '22 06:09

apneadiving