How do I remove Permission denied @ rb_sysopen - G

2019-05-19 22:35发布

I am trying to install create a new app in Ruby on Rails and I cannot get passed this error:

$ gem install pg

ERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen - /Users/stormyramsey/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/pg-0.21.0/.gemtest

2条回答
老娘就宠你
2楼-- · 2019-05-19 22:50

Its a permissions issue. You could fix it with this:

sudo chown -R $(whoami) /Library/Ruby/Gems/*

or possibly in your case

sudo chown -R $(whoami) /Users/stormyramsey/.rbenv/versions/2.3.2/lib/ruby/gems/*
查看更多
手持菜刀,她持情操
3楼-- · 2019-05-19 23:12

It's likely there's a permissions problem somewhere along the .rbenv path. You might try turning on write privileges for your user with:

$ chmod -R +w ~/.rbenv

That will recursively (-R) change the file mode (chmod) to write permission (+w) for all files and directories under your user's .rbenv path. There's no particular reason for not having files set to write.

查看更多
登录 后发表回答