rbenv installation permission denied

岁酱吖の 提交于 2019-12-07 05:06:38

问题


Hi all I'm trying to set up a dev environment and I've been following a tutorial via; Link to tutorial

I'm not doing very well and have no real experience of terminal commands other than the most basic version control stuff. I followed the first link and when trying to run

source ~/.bash_profile

I got the error; mkdir: /usr/local/rbenv/shims: Permission denied mkdir: /usr/local/rbenv/versions: Permission denied

Now every time I load terminal the error appears.

Contents of bash_profile;

export PATH=/usr/local/rbenv/bin:$PATH
export RBENV_ROOT=/usr/local/rbenv
eval "$(rbenv init -)"

Any guidance would be greatly appreciated


回答1:


It looks like the rbenv setup puts a line of shell scripting in your .bash_profile that attempts to create that directory. You could either give yourself permissions to create directories in /usr/local/rbenv, or sudo mkdir /directories/that/need/to/be/created once.

sudo mkdir -p /usr/local/rbenv/shims
sudo mkdir -p /usr/local/rbenv/versions



回答2:


This was pretty useful System Wide Install With rbenv Specifically changing the permissions of rbenv directory to a group the users are in:

chgrp -R staff /usr/local/rbenv chmod -R g+rwxXs /usr/local/rbenv



来源:https://stackoverflow.com/questions/31588604/rbenv-installation-permission-denied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!