summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNgan Pham <ngan@users.noreply.github.com>2023-08-17 21:19:58 -0700
committergit <svn-admin@ruby-lang.org>2023-08-18 19:14:14 +0000
commit3d7a0301124aa1fb4a6fc1a92baf4f2601b8d2ea (patch)
tree9e041da9d9031f4012211f7df24e7d7001a31c69 /lib
parente1505aebf2dd5876db227f3e0c70e9ad1c4302fd (diff)
[rubygems/rubygems] Resolve ruby version file relative to bundle root
This is a follow up to https://github.com/rubygems/rubygems/issues/6742. This change makes it so that the version file is resolved relative to the Bundle root instead of the working directory. Why is this useful? If you run a commnad (eg `rails`) from the `app/` directory, your bundle would fail to load. https://github.com/rubygems/rubygems/commit/6d47ee98b9
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/ruby_dsl.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/ruby_dsl.rb b/lib/bundler/ruby_dsl.rb
index d054969e8d..7c101c794f 100644
--- a/lib/bundler/ruby_dsl.rb
+++ b/lib/bundler/ruby_dsl.rb
@@ -11,7 +11,7 @@ module Bundler
if options[:file]
raise GemfileError, "Cannot specify version when using the file option" if ruby_version.any?
- ruby_version << Bundler.read_file(options[:file]).strip
+ ruby_version << Bundler.read_file(Bundler.root.join(options[:file])).strip
end
if options[:engine] == "ruby" && options[:engine_version] &&