Search code examples
rubybundler

Specify path to Gemfile


How do I tell bundler to no search the Gemfile in the current directory but somewhere else?

I want to do

bundle install --some-option path/to/Gemfile

instead of

cd path/to & bundle install

Solution

  • You can use the --gemfile option:

    --gemfile= The location of the Gemfile(5) which Bundler should use. This defaults to a Gemfile(5) in the current working directory. In general, Bundler will assume that the location of the Gemfile(5) is also the project's root and will try to find Gemfile.lock and vendor/cache relative to this location.

    Source: Bundler manual