Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing Gem Fails With Permission Error #19

Closed
sanssecours opened this issue Nov 11, 2019 · 3 comments
Closed

Installing Gem Fails With Permission Error #19

sanssecours opened this issue Nov 11, 2019 · 3 comments

Comments

@sanssecours
Copy link

👋 Hi,

first I would like to thank you for offering your great CI service for FLOSS software for free. It works really well and is quite fast too. After this round of well deserved praise 😊, it is probably time to write about the problem I noticed with some of the recent changes to the macOS images.

It seems like it is no longer possible to install Ruby gems with the Homebrew’s version of Ruby. I created a project that shows this problem here. As you can see in the log file, the command gem install fails with a file permission error:

#<Thread:0x00007fc9e9a8ebb0@/usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/request_set.rb:168 run> terminated with exception (report_on_exception is true):
/usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems.rb:873:in `initialize': Permission denied @ rb_sysopen - /usr/local/lib/ruby/gems/2.6.0/cache/ronn-0.7.3.gem (Errno::EACCES)
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems.rb:873:in `open'
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems.rb:873:in `write_binary'
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/remote_fetcher.rb:315:in `cache_update_path'
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/remote_fetcher.rb:159:in `download'
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/source.rb:206:in `download'
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/resolver/specification.rb:101:in `download'
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/request_set.rb:174:in `block (2 levels) in install'
#<Thread:0x00007fc9e9a8ef20@/usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/request_set.rb:168 run> terminated with exception (report_on_exception is true):
/usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems.rb:873:in `initialize': Permission denied @ rb_sysopen - /usr/local/lib/ruby/gems/2.6.0/cache/mustache-1.1.0.gem (Errno::EACCES)
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems.rb:873:in `open'
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems.rb:873:in `write_binary'
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/remote_fetcher.rb:315:in `cache_update_path'
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/remote_fetcher.rb:159:in `download'
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/source.rb:206:in `download'
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/resolver/specification.rb:101:in `download'
	from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/request_set.rb:174:in `block (2 levels) in install'
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_sysopen - /usr/local/lib/ruby/gems/2.6.0/cache/mustache-1.1.0.gem

The installation even fails with this permission error if I use the option --user-install.

Another minor problem I noticed is the banner “High Sierra images were deprecated! Auto upgraded to mojave-xcode-11.2.1”. This message seems rather strange, since cirrus.yml already specifies a macOS Mojave image.

@fkorotkov
Copy link
Contributor

Hey @sanssecours, there was a change to switch from the pre-installed version of ruby that comes with Mojave to the latest by installing it with brew. Seems like you'll need to use sudo in order to globally install things in /usr/local/lib/ruby/. See https://github.com/sanssecours/Test-Cirrus/pull/1

@fkorotkov
Copy link
Contributor

BTW sorry for the false warning message. Your task was upgrade from mojave-xcode-11.1 to mojave-xcode-11.2.1. No High Sierra involved.

sanssecours added a commit to sanssecours/elektra that referenced this issue Nov 11, 2019
@sanssecours
Copy link
Author

sanssecours commented Nov 11, 2019

Hey @sanssecours, there was a change to switch from the pre-installed version of ruby that comes with Mojave to the latest by installing it with brew. Seems like you'll need to use sudo in order to globally install things in /usr/local/lib/ruby/.

Thank you for the information. I still do wonder why using --user-install requires superuser privileges. It worked before without sudo. Anyway, thank you for the quick and helpful reply 💖.

sanssecours added a commit to sanssecours/elektra that referenced this issue Nov 11, 2019
sanssecours added a commit to sanssecours/elektra that referenced this issue Nov 12, 2019
sanssecours added a commit to sanssecours/elektra that referenced this issue Nov 12, 2019
sanssecours added a commit to sanssecours/elektra that referenced this issue Nov 12, 2019
sanssecours added a commit to sanssecours/elektra that referenced this issue Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants