Having somehow managed to get a pile of extensions miscompiled, I'm now being prompted to run gem pristine <gem> --version <something> for rather a lot of things. However, it isn't working so well:
$ gem pristine unicorn --version 5.3.0
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /var/lib/gems/2.3.0 directory.
$ sudo gem pristine unicorn --version 5.3.0
ERROR: While executing gem ... (Gem::Exception)
Failed to find gems ["unicorn"] = 5.3.0
I install all my gems with --user-install by default (my ~/.gemrc has install: --user-install), so it's not surprising that running gem pristine as root gets confused, however I'm somewhat perturbed that running gem pristine as me is erroring out.
If I explicitly set GEM_HOME=~/.gem and then run gem pristine, everything seems to work, but my understanding was that doing that in general was considered poor form, and that --user-install was the recommended solution.
Here are my current environment details:
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.5.2
- RUBY VERSION: 2.3.3 (2016-11-21 patchlevel 222) [x86_64-linux-gnu]
- INSTALLATION DIRECTORY: /var/lib/gems/2.3.0
- USER INSTALLATION DIRECTORY: /home/mpalmer/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /usr/bin/ruby2.3
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /home/mpalmer/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/2.3.0
- /home/mpalmer/.gem/ruby/2.3.0
- /usr/lib/x86_64-linux-gnu/rubygems-integration/2.3.0
- /usr/share/rubygems-integration/2.3.0
- /usr/share/rubygems-integration/all
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- :benchmark => false
- :sources => ["https://rubygems.org/"]
- "install" => "--user-install --no-ri --no-rdoc --env-shebang"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/mpalmer/.gem/ruby/2.3.0/bin
[etc]
$ sudo gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.5.2
- RUBY VERSION: 2.3.3 (2016-11-21 patchlevel 222) [x86_64-linux-gnu]
- INSTALLATION DIRECTORY: /var/lib/gems/2.3.0
- USER INSTALLATION DIRECTORY: /root/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /usr/bin/ruby2.3
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /root/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/2.3.0
- /root/.gem/ruby/2.3.0
- /usr/lib/x86_64-linux-gnu/rubygems-integration/2.3.0
- /usr/share/rubygems-integration/2.3.0
- /usr/share/rubygems-integration/all
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- :benchmark => false
- :sources => ["http://rubygems.org/"]
- REMOTE SOURCES:
- http://rubygems.org/
- SHELL PATH:
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
I will abide by the code of conduct.
Having somehow managed to get a pile of extensions miscompiled, I'm now being prompted to run
gem pristine <gem> --version <something>for rather a lot of things. However, it isn't working so well:I install all my gems with
--user-installby default (my~/.gemrchasinstall: --user-install), so it's not surprising that runninggem pristineasrootgets confused, however I'm somewhat perturbed that runninggem pristineas me is erroring out.If I explicitly set
GEM_HOME=~/.gemand then rungem pristine, everything seems to work, but my understanding was that doing that in general was considered poor form, and that--user-installwas the recommended solution.Here are my current environment details:
I will abide by the code of conduct.