Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I don't completely understand the gemfile in a rails application

What is the difference between installing a gem from the command line

sudo gem install gem-name

and writing your gem into the Gemfile and running bundle install?

I think the problem is that I don't understand the exact purpose of the Gemfile. So far it seems like it is a place to list all of the gems that your app is dependent on.

like image 905
Spencer Cooley Avatar asked Mar 20 '11 18:03

Spencer Cooley


1 Answers

Installing a gem via:

sudo gem install gem-name

is going to install that gem system wide.

Whereas installing them via the Gemfile is specific for your rails app(to keep track of dependencies, version, app portability etc).

like image 190
Mike Lewis Avatar answered Oct 10 '22 01:10

Mike Lewis