Actions
Bug #12667
closedfull_gem_path is incorrect for core modules
Description
#find_full_gem_path
assumes all gems are in gems_dir
. It also leverages full_name
, which assumes the directory includes the version. Neither is correct for core modules that behave like gems (e.g., JSON), which are located in lib/ruby/2.3.0
instead of lib/ruby/gems/2.3.0/gems
and are unversioned. This causes #full_gem_path
to return an incorrect value:
> spec = Gem::Specification::load('~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/specifications/default/json-1.8.3.gemspec')
=> #<Gem::Specification:0x3fc7f944ef20 json-1.8.3>
> spec.full_gem_path
=> "~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/json-1.8.3"
In this case, #full_gem_path
should return ~/.rbenv/versions/2.3.1/lib/ruby/2.3.0/json
.
This incorrect value causes anything that depends upon #full_gem_path
to find the gem to fail; e.g., bundle show
:
% bundle show json
The gem json has been deleted. It was installed at:
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/json-1.8.3
Updated by hsbt (Hiroshi SHIBATA) over 5 years ago
- Status changed from Open to Assigned
- Assignee set to hsbt (Hiroshi SHIBATA)
Updated by jeremyevans0 (Jeremy Evans) about 5 years ago
- Status changed from Assigned to Closed
Actions
Like0
Like0Like0Like0