Open In App

How to Install Ruby gems offline?

Last Updated : 13 Apr, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Ruby is a type of programming language. As it is open source & high level in nature, it can be used in several fields. It is well known for its productivity and simplicity. RubyGems is a package manager. RubyGems is used when there is a need to install Gems for Ruby. Gems can be installed either Online or in Offline mode. While creating Gems in offline mode it can be called Local Gems. Local Gems are usually preferred while some confidential documents are being handled.

Features:

  • Ruby is well known for its speed while executing any code.
  • Ruby provides an interactive UI.
  • Ruby can be installed on any platform. So, it is platform-independent also.
  • In Ruby, all chunks of code, even a small block also has its own property.

Installing Gems Without Internet Access

Follow the following steps to install Gems Without Internet Access:

Step 1: At first, the following command should be run in the terminal. This command will open a new Gemset in Ruby. Gemset is the starting point when creating the Gems. For installing this, Ruby must be installed in the system previously.

rvm gemset create demo

Open-a-new-Gemset-in-Ruby

 

Step 2: After creating Gemset, it is going to be used in further processes as well. The following command should be run. This will use the demo Gemset.

rvm gemset use demo

Creating-Gemset

 

Step 3: Then the following command should be used. Using this command, it is giving the instruction to Ruby that a new Gems which is in Offline mode are going to create. The Gems name will be used for further process.

gem list <name>

Giving-the-instruction-to-Ruby

 

Step 4: Then using the Gems name, it will be installed in the machine. The following command should be used to install a Gem in offline mode. While installing the internet must be disconnected. Wait for some time, as it will need time.

gem install <name>

Install-a-Gem

 

Step 5: At last, Gems are created in the offline mode. Now, the Gems details can be verified. The below command should be used to check the details of the newly created offline mode Gems. Hence, creating Gems in offline mode is successful.

gem info <name>

Creating-Gems-in-offline-mode-is-successful

 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads