Skip to content
Related Articles
Get the best out of our app
Open App

Related Articles

How to Install Gems from Gemfile in Ruby?

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Ruby is a dynamic and object-oriented, general-purpose programming language. Ruby’s development was to make it act as a sensible buffer between human programmers and the underlying computing machinery. Basically, Ruby gems are open-source libraries that contain codes packaged with data. By using a gem, programmers can use the code within the gem in their own program. 

Steps to Install Gems from Gemfile in Ruby

If you do not have Ruby on your computer you can refer to this article install Ruby. After installing the ruby programming language now we install the ruby gems from gemfile. Follow the steps to install Ruby Gems from Gemfile:

Step 1: Open the terminal and write gem install “gemname”, for example, gem install abc.

 gem install “gemname”



Step 2: Bundler provides a consistent environment for Ruby projects by tracking and installing the needed gems and versions. Now we install Bundler using the command.

 gem install bundler 



Step 3: Now initializes the bundle using the init function, If you are getting an error in the terminal you can open any code editor in that folder in which the bundle installs and initializes the root directory.

bundle init



Step 4: Bundler is a gem that manages dependencies. It creates an environment for Ruby projects. Now open the root directory and create Gemfile. Now open the Gemfile with the code editor and Specify the dependencies in a Gemfile.

source ‘’
gem ‘multi_json’
gem ‘rack’
gem ‘rspec’
gem  ‘watir’



Step 5: Now the install is required gems from the above sources by using the command in the code editor terminal.

bundle install



Step 6: To verify gems installed, write the command in the terminal that gives the full list of gems installed in your computer.

gem list



My Personal Notes arrow_drop_up
Last Updated : 04 Jan, 2023
Like Article
Save Article
Similar Reads
Related Tutorials