Search code examples
ruby-on-railsrubygemsbundler

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


Solution

  • 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.