Cannot update RubyGems Errno::EACCES

rubygems

#1

Hi all,

It all started with error installing bundler:

Fetching: bundler-2.0.0.gem (100%)
ERROR:  Error installing bundler:
  The last version of bundler (>= 0) to support your Ruby & RubyGems was 1.17.3. Try installing it with `gem install bundler -v 1.17.3`
  bundler requires RubyGems version >= 3.0.0. The current RubyGems version is 2.7.7. Try 'gem update --system' to update RubyGems itself.

To update Rubygems as suggested, I’ve added “gem update --system”, though it still doesn’t work:

#!/bin/bash -eo pipefail
gem update --system
gem install bundler
bundle install --jobs=4 --retry=3 --path vendor/bundle --without development

Updating rubygems-update
Fetching: rubygems-update-3.0.2.gem (100%)
Successfully installed rubygems-update-3.0.2
Installing RubyGems 3.0.2
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_sysopen - /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/ext/ext_conf_builder.rb
Fetching: bundler-2.0.0.gem (100%)
ERROR:  Error installing bundler:
  The last version of bundler (>= 0) to support your Ruby & RubyGems was 1.17.3. Try installing it with `gem install bundler -v 1.17.3`
  bundler requires RubyGems version >= 3.0.0. The current RubyGems version is 2.7.7. Try 'gem update --system' to update RubyGems itself.
Exited with code 1

The following latest topics I’ve found say it’s fixed:
https://status.rubygems.org/incidents/dh3cd8fjd5qw
https://github.com/rubygems/rubygems/issues/2541

But I still get this error.

Thanks for any help,
Max


#2

Alright, I think I figured it out.

I just had to remove the bundler install line. No need in gem update --system also.

“Run” section looks like this now:

- run:
    name: Install dependencies
    command: |
    bundle install --jobs=4 --retry=3 --path vendor/bundle --without development

#3

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.