Site5 - Built For Designers & Developers MENU
Home  ›  Ruby & Ruby On Rails  ›  Installing Gems Using Bundler

Installing Gems Using Bundler

Comments Off on Installing Gems Using Bundler

This article assumes that you already have a basic understanding of Rails and how to use a terminal.

Bundler manages all gems in a file called “Gemfile” in the root directory of your application (~/yourapp/Gemfile). If you ever want to install more gems for your application, this is the file you need to edit. Open it up in your text editor and you can see that the format is fairly easy to understand. The default Rails Gemfile should look something similar to the below (don’t worry if it’s slightly different):

source 'http://rubygems.org'

gem 'rails', '3.1.0'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'mysql2'

gem 'json'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails', " ~> 3.1.0"
  gem 'coffee-rails', "~>; 3.1.0"
  gem 'uglifier'
end

gem 'jquery-rails'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug'

Once you have added the gems and versions that you wish to install to the Gemfile, we will need to process the changes by running the following command:

cd ~/yourapp/; bundle install --path vendor/bundle

That’s it!

For more detailed information about Bundler, please see the Bundler website

Still have a question? Or need help?
See an error in this article or want to suggest a missing topic? Please leave us a comment below! If you need technical support with your account, please email us, chat live with a representative, or call us!

Comments are closed.

Money Back Guarantees
Click to verify BBB accreditation and to see a BBB report.