Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

3 participants

@sodabrew

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!

@travisbot

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

@sodabrew

Hi TravisBot! Um?

@indirect
Owner

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!

@indirect 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
View
8 lib/bundler/installer.rb
@@ -124,8 +124,9 @@ def generate_standalone_bundler_executable_stubs(spec)
end
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}"
FileUtils.mkdir_p(bundler_path)
paths = []
@@ -145,8 +146,7 @@ def generate_standalone(groups)
end
end
-
- File.open File.join(bundler_path, "setup.rb"), "w" do |file|
+ File.open 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.