Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ruby/private/bundle/create_bundle_build_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,16 @@ def register_gem(spec, template_out, bundle_lib_paths, bundle_binaries)
# Usually, registering the directory paths listed in the `require_paths` of gemspecs is sufficient, but
# some gems also require additional paths to be included in the load paths.
require_paths += include_array(spec.name)
gem_lib_paths = require_paths.map { |require_path| File.join(gem_path, require_path) }

gem_lib_paths = require_paths.map do |require_path|
require_pathname = Pathname.new(require_path)
# Require_path may be an absolute path to a gem extension.
if require_pathname.absolute?
# Computing the relative path to gem_path to match the other files in require_paths
require_pathname = require_pathname.relative_path_from(File.absolute_path(gem_path))
end
Pathname.new(gem_path).join(require_pathname).cleanpath.to_s
end
bundle_lib_paths.push(*gem_lib_paths)

# paths to search for executables
Expand Down