Search code examples
rubymacosrubygemsbundler

Errno::EACCES: Permission denied @ rb_sysopen on http-parser 1.2.3


I've updated my macOS to Big Sur 11.3.1 and reinstall the xcode command. When I run bundle install for my Gemfile (I didn't use rail), it occurs error when install the gem http-parser 1.2.3.

Then it occurs the error:

Errno::EACCES: Permission denied @ rb_sysopen - /Users/relaxlalalala/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-18/3.0.0/http-parser-1.2.3/gem.build_complete

I've tried

sudo chown -R relaxlalalala .rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-18/3.0.0/http-parser-1.2.3/gem.build_complete

but it said

chown: .rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-18/3.0.0/http-parser-1.2.3/gem.build_complete: No such file or directory

How can I get the folder permission or resolve the gem.build_complete problem?


Solution

  • What should the permissions be?

    Looking at my own rbenv installation,

    • I own all files under ~/.rbenv, and
    • directories under ~/.rbenv are drwxr-xr-x (755) and
    • files are either -rw-rw-r-- (664) or
    • -rwxrwxr-x (775), if they are meant to be executable.

    Recommendation

    Just reinstall everything :)

    rbenv uninstall 3.0.1
    rbenv install 3.0.1
    bundle install