Gemfile Options
You can do any of the following in the Gemfile:
gem "name", "version"
:version
may be a strict version or a version requirement like>= 1.0.6
. The version is optional.gem "name", "version", :require_as => "file"
: therequire_as
allows you to specify which file should be required when therequire_env
is called. By default, it is the gem’s namegem "name", "version", :only => :testing
: The environment name can be anything. It is used later in yourrequire_env
call. You may specify either:only
, or:except
constraintsgem "name", "version", :git => "git://github.com/wycats/thor"
: Specify a git repository to be used to satisfy the dependency. You must use a hard dependency (“1.0.6″) rather than a soft dependency (“>= 1.0.6″). If a .gemspec is found in the repository, it is used for further dependency lookup. If the repository has multiple .gemspecs, each directory will a .gemspec will be considered a gem.gem "name", "version", :git => "git://github.com/wycats/thor", :branch => "experimental"
: Further specify a branch, tag, or ref to use. All of :branch, :tag, and :ref are valid optionsgem "name", "version", :vendored_at => "vendor/nokogiri"
: In the next version of bundler, this option will be changing to:path
. This specifies that the dependency can be found in the local file system, rather than remotely. It is resolved relative to the location of the Gemfileclear_sources
: Empties the list of gem sources to search inside of.source "http://gems.github.com"
: Adds a gem source to the list of available gem sources.bundle_path "vendor/my_gems"
: Changes the default location of bundled gems fromvendor/gems
bin_path "my_executables"
: Changes the default location of the installed executablesdisable_system_gems
: Without this command, both bundled gems and system gems will be used. You can therefore have things likeruby-debug
in your system and use it. However, it also means that you may be using something in development mode that is installed on your system but not available in production. For this reason, it is best todisable_system_gems
disable_rubygems
: This completely disables rubygems, reducing startup times considerably. However, it often doesn’t work if libraries you are using depend on features of Rubygems. In this mode, the bundler shims the features of Rubygems that we know people are using, but it’s possible that someone is using a feature we’re unaware of. You are free to trydisable_rubygems
first, then remove it if it doesn’t work. Note that Rails 2.3 cannot be made to work in this modeonly :environment { gem "rails" }
: You can useonly
orexcept
in block mode to specify a number of gems at once
Comments
Post a Comment