Attempting to bundle install results in permission denied error

Asked 2 months ago, Updated 2 months ago, 1 views

$bundle install results in permission denied and the Gem cannot be installed.

Error Contents

The dependency tzinfo-data(>=0)will be unused by any of the platforms Bundler is installing for .Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java.Toddose bundle `the bundle --
Fetching gem metadata from
Fetching gem metadata from
Resolving dependencies......
Using rake 13.0.1
Using concurrent-ruby 1.1.5
Using i18n 1.7.0
Using minitest 5.13.0
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activities support 5.2.3
Using builder 3.2.3
Using erubi 1.9.0
Using mini_portile 22.4.0
Fetching Nokogiri 1.10.5
Errno::EACCES:Permission [email protected]_file_s_rename-
Error occurred while installing Nokogiri (1.10.5), and Bundler cannot continue.
Make sure that `gem install nokogiri-v'1.10.5' -- source '' `succeeds before

In Gemfile:
  rails was resolved to 5.2.3, which depend on
    actioncable was resolved to 5.2.3, which depend on
      actionpack was resolved to 5.2.3, which depend on
        actionview was resolved to 5.2.3, which depend on
          rails-dom-testing was resolved to 2.0.3, which depend on

As stated in the error message,
gem install nokogiri-v'1.10.5' --source'' did not work.

Search for "nokogiri" in

Paste gem'nokogiri', '~>1.10', '>=1.10.5' into Gemfile
$gem install nokogiriexecute

Permission denied @rb_sysopen-/Users/username/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/nokogiri-1.10.5/


2022-09-30 11:50

1 Answers

When permission errors occur during Gem installation, sudo and bundle or gem operations are often caused by lack of permission to overwrite files.

I think the easiest solution is to reinstall rbenv and re-enter gem.

2022-09-30 11:50

If you have any answers or tips

© 2022 OneMinuteCode. All rights reserved.