Gems for ruby are third party add-ins which extend the functionality of Ruby. A list of specific Gems used by a Ruby project can be found in the projects Gemfile.
A simple example of a Gem often included in Rails project is:
Gems can all be specified more succinctly if necessary such as specifying:
- a specific version of a Gem
- gem 'jquery-rails', 3.0.4'
- a minimum version
- gem 'jquery-rails', '=> 3.0.4'
- or a minimum point release (this will find the highest point release version but will not jump to the next full version)
- gem 'jquery-rails', '~>3.0.4'
You can also specify in what situation to use a certain gem. For example, the following snippet specifies that the jQuery-rails version 3.0.4 should only be used during development.
group :development do gem 'jquery-rails', '3.0.4' end
After Gem files are updated, you need to run
bundle update, and
at the terminal command prompt to ensure the correct files have been downloaded and are used in your application.
A list of and help for Gem files can be found at http://rubygems.org/