Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how does gem installation works ? how did gem get the installation files?

when I wanted to install SASS, I have been told to install ruby on my machine, ok fine.

then all I had to do is to run the following code

gem install sass

and now I am done, and I have SASS installed

my question is in general..

How did gem knows what SASS is, and from where did it get it ?

It is a cool thing but I just want to know what happened behind the scenes ?

Thanks

like image 752
Anas Nakawa Avatar asked Jul 10 '11 10:07

Anas Nakawa


People also ask

How does gem install work?

What does gem install do? 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):

Where does gem get installed?

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.

How does gem file work?

A Gemfile describes the gem dependencies required to execute associated Ruby code. Place the Gemfile in the root of the directory containing the associated code. For instance, in a Rails application, place the Gemfile in the same directory as the Rakefile .


1 Answers

RubyGems is a package manager like many others. It depends on a central repository to host installable packages. The command line tool fetches these packages from the central repository and installs them.

See RubyGems FAQ and Introduction.

like image 52
deceze Avatar answered Nov 08 '22 15:11

deceze