Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


When using --standalone, place the setup.rb file relative to the gem install path, rather than the working directory #1645

wants to merge 1 commit into from

3 participants

Aaron Stone Don't Add Me To Your Organization a.k.a The Travis Bot André Arko
Aaron Stone

For issue #1643 I am running bundler from the root of my project. There are several subdirectories with their own Gemfiles. For each subdirectory, I run:

bundle install --gemfile=path/to/Gemfile --standalone

This installs the gems into path/to/vendor/bundle/ruby.

However the setup.rb file is created at vendor/bundle/bundler/setup.rb, in the project root. I would like this file to be located at path/to/vendor/bundle/bundler/setup.rb. This patch provides the desired behavior. Thanks!

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request fails (merged 18097dc into 42d2c3e).

Aaron Stone

Hi TravisBot! Um?

André Arko

So Bundler.settings[:path] is actually the install directory, and not the working directory. If you're not seeing that, please open a new issue with a repro case, and I'll see about getting it fixed. Thanks!

André Arko indirect closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/bundler/installer.rb
8 lib/bundler/installer.rb
@@ -124,8 +124,9 @@ def generate_standalone_bundler_executable_stubs(spec)
def generate_standalone(groups)
- standalone_path = Bundler.settings[:path]
- bundler_path = File.join(standalone_path, "bundler")
+ bundler_path = File.expand_path(File.join(Bundler.rubygems.gem_path, "..", "..", "bundler"))
+ bundler_setup_file = File.join(bundler_path, "setup.rb")
+ Bundler.ui.debug "Generating standlone include file #{bundler_setup_file}"
paths = []
@@ -145,8 +146,7 @@ def generate_standalone(groups)
- File.join(bundler_path, "setup.rb"), "w" do |file|
+ bundler_setup_file, "w" do |file|
file.puts "path = File.expand_path('..', __FILE__)"
paths.each do |path|
file.puts %{$:.unshift File.expand_path("\#{path}/#{path}")}
Something went wrong with that request. Please try again.