Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between GEM_HOME and GEM_PATH?

Tags:

ruby

rubygems

RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a "gem"), a tool designed to easily manage the installation of gems, and a server for distributing them. It is analogous to EasyInstall for the Python programming language. RubyGems is now part of the standard library from Ruby version 1.9.

That said, what's the difference between GEM_HOME and GEM_PATH?

like image 626
Michiel de Mare Avatar asked Jun 30 '12 19:06

Michiel de Mare


People also ask

What is Gem_path?

GEM_PATH provides the locations (there may be several) where gems can be found. GEM_HOME is where gems will be installed (by default).

Where is Gem_path set?

/etc/profile. /etc/profile.

Where does ruby look for gems?

The main place where libraries are hosted is RubyGems.org, a public repository of gems that can be searched and installed onto your machine. You may browse and search for gems using the RubyGems website, or use the gem command. Using gem search -r , you can search RubyGems' repository.

Where are gems installed?

When you use the --user-install option, RubyGems will install the gems to a directory inside your home directory, something like ~/. gem/ruby/1.9. 1 . The commands provided by the gems you installed will end up in ~/.


1 Answers

GEM_PATH provides the locations (there may be several) where gems can be found.

GEM_HOME is where gems will be installed (by default).

(Therefore GEM_PATH should include GEM_HOME).

like image 143
Michiel de Mare Avatar answered Oct 18 '22 02:10

Michiel de Mare