Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Gem::Commands::UnpackCommand#get_path

get_path(dependency)

Return the full path to the cached gem file matching the given name and version requirement. Returns ‘nil’ if no match.

Example:

Example
get_path 'rake', '> 0.4' # "/usr/lib/ruby/gems/1.8/cache/rake-0.4.2.gem"
get_path 'rake', '< 0.1' # nil
get_path 'rak'           # nil (exact name required)
See also #find_in_cache #execute also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0