ruby pkg and user gem/bundle privilege mismatch

Gary Aitken freebsd at dreamchaser.org
Mon Jan 25 17:31:42 UTC 2021


Some time ago I installed ruby vi pkg install (as root).
Now working in my normal user account, I run into privilege violations
when trying to do a bundle install:

Errno::EACCES: Permission denied @ rb_file_s_rename - (/home/me/.gem/ruby/2.6/cache/rake-13.0.3.gem,
/usr/local/lib/ruby/gems/2.6/cache/rake-13.0.3.gem)
An error occurred while installing rake (13.0.3), and Bundler cannot continue.
Make sure that `gem install rake -v '13.0.3' --source 'https://rubygems.org/'` succeeds before bundling.

gem install rake -v '13.0.3' --source 'https://rubygems.org/'
ERROR:  While executing gem ... (Gem::FilePermissionError)
     You don't have write permissions for the /usr/local/lib/ruby/gems/2.6 directory.

This is all true...
However, there is a /home/me/.gem/ruby/2.6/cache/rake-13.0.3.gem

Is this a path issue, or some larger privilege issue?

/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/local/libexec:/home/me/bin

I installed rails as root using "gem install rails --version '=5.2.4'

What's the difference between a pkg install of rails and "rem install"?

Is it possible to mix a system ruby installation and user gem installs?
Do I need to install rvm in order to do that?

Gary


More information about the freebsd-questions mailing list