Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'rubygems'
gem_path = "/some/path"
if ENV['GEM_PATH']
ENV['GEM_PATH'] = gem_path + File::PATH_SEPARATOR + ENV['GEM_PATH']
else
ENV['GEM_PATH'] = gem_path
end
p ENV['GEM_PATH']
puts 'Before: ' + Gem.path.join(",")
Gem.clear_paths
puts 'After: ' + Gem.path.join(",")
@ericanderson

This comment has been minimized.

Copy link
Owner Author

@ericanderson ericanderson commented Feb 2, 2011

Output:
Before: /Users/ericanderson/.gem/jruby/1.8,file:/var/folders/Ya/YaQlmSXlENWXcVtOs-RdeE+++TI/-Tmp-/jruby8338768757345880582extract/jruby-stdlib-1.5.6.jar!/META-INF/jruby.home/lib/ruby/gems/1.8
After: file:/var/folders/Ya/YaQlmSXlENWXcVtOs-RdeE+++TI/-Tmp-/jruby8338768757345880582extract/jruby-stdlib-1.5.6.jar!/META-INF/jruby.home/lib/ruby/gems/1.8

@ericanderson

This comment has been minimized.

Copy link
Owner Author

@ericanderson ericanderson commented Feb 2, 2011

Can't get Gem.path to return "/some/path"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment