How do I remove Permission denied @ rb_sysopen - Gem install error?

后端 未结 2 2017
有刺的猬
有刺的猬 2021-02-05 15:36

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 exec

2条回答
  •  北恋
    北恋 (楼主)
    2021-02-05 16:10

    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/*
    

    What does this do:

    This is telling the system to change the files to change the ownership to the current user. Something must have gotten messed up when something got installed. Usually this is because there are multiple accounts or users are using sudo to install when they should not always have to.

提交回复
热议问题