Gemfile and how to use them.
source :rubygems source 'http://rubygems.org' source :rubyforge source 'http://gems.rubyforge.org' source :gemcutter source 'http://gemcutter.org'
gem 'nokogiri' gem 'rails', '3.0.0.beta3' gem 'rack', ''>=1.0' gem 'thin', '~>1.1'
>= 1.0, are self-explanatory.
The specifier ~> has a special meaning, best shown by example.
~> 2.0.3 is identical to >= 2.0.3 and < 2.1.
~> 2.1 is identical to >= 2.1 and < 3.0.
~> 2.2.beta will match prerelease versions like 2.2.beta.12.
gem 'rspec', :require => 'spec' gem 'sqlite3'
Gemfile, you will need to call
Bundler.require in your application.
:tag,
:branch, or :ref. The default is the master branch.
gem 'nokogiri', :git => 'git://github.com/tenderlove/nokogiri.git', :branch => '1.4' git 'git://github.com/wycats/thor.git', :tag => 'v0.13.4' gem 'thor'
.gemspec file, bundler
will create a simple one, without any dependencies, executables or C extensions.
This may work for simple gems, but not work for others. If there is no .gemspec,
you probably shouldn't use the gem from git.
gem 'nokogiri', :path => '~/sw/gems/nokogiri'
gem 'wirble', :group => :development gem 'ruby-debug', :group => [:development, :test] group :test do gem 'rspec' endLearn more: Groups
Gemfile like the following:
ruby '1.9.3'
:engine and :engine_version options.
ruby '1.9.3', :engine => 'jruby', :engine_version => '1.6.7'Learn More: Ruby Directive
Many thanks to Bundler's contributors and sponsors