1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

gem install fails when config doesn't have --user-install set

This commit is contained in:
Ahsan Dar 2014-10-02 16:16:25 +01:00
parent 6d5eb0831b
commit 47fac2073a

View file

@ -57,7 +57,8 @@ class Pry
# @param [String] name # @param [String] name
# @return [void] # @return [void]
def install(name) def install(name)
gemrc_opts = Gem.configuration['gem'].split(' ') gem_config = Gem.configuration['gem']
gemrc_opts = (gem_config.nil? ? "" : gem_config.split(' '))
destination = if gemrc_opts.include?('--user-install') destination = if gemrc_opts.include?('--user-install')
Gem.user_dir Gem.user_dir
elsif File.writable?(Gem.dir) elsif File.writable?(Gem.dir)