Dienstag, 15. August 2023 16:55:

 
> Hello list,

> I'd like to develop a blog using www-apps/jekyll, which makes extensive use 
> of 
> ruby gems, of which I have no experience. On trying to install a new default 
> theme I get copious permission errors.

> The ruby gems live in /usr/lib64/ruby/gems/3.1.0/gems, and to install 
> anything 
> in that tree I need write permission on the destination directory and execute 
> permission on all those above it.

> This poses an obvious security problem.

> When I emerged jekyll and ran its installation routine, I found I had a new ~/
> bin directory with nine executable files in it. ~/bin/update_rubygems has 
> similar permission problems but is more concise in reporting them

> I can't add myself to a group and grant it permissions, because there seems 
> not to be any such group.

> How do Gentoo Ruby users get around this?



 Hello Peter,

first make sure that you don't have any "suspicious" rubygem based
executables in your path that might confuse things. Some time ago
I found some ancient such files in /usr/local/bin ...

Next, with a default ruby/rubygems installation, a normal user should
be able to install gems into their own $HOME/.gem directory. I'm doing
this on several gentoo boxes, never had a problem with that approach.

On one of the servers, I can run the following command, to which you can
compare your environment

 $ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 3.3.26
  - RUBY VERSION: 3.1.4 (2023-03-30 patchlevel 223) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/lib64/ruby/gems/3.1.0
  - USER INSTALLATION DIRECTORY: /home/.../.gem/ruby/3.1.0
  - RUBY EXECUTABLE: /usr/bin/ruby31
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /usr/bin
  - SPEC CACHE DIRECTORY: /home/.../.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - x86_64-linux
  - GEM PATHS:
     - /usr/lib64/ruby/gems/3.1.0
     - /home/.../.gem/ruby/3.1.0
     - /usr/local/lib64/ruby/gems/3.1.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => true
     - :bulk_threshold => 1000
     - "install" => "--install-dir /home/.../.gem/ruby/3.1.0 --bindir 
/home/.../bin"
     - "uninstall" => "--install-dir /home/.../.gem/ruby/3.1.0 --bindir 
/home/...bin"
     - "update" => "--install-dir /home/.../.gem/ruby/3.1.0 --bindir 
/home/.../bin"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /opt/bin



Reply via email to