Permission to install rbenv is prohibited

Hi everyone, I'm trying to set up a dev environment, and I'm following a tutorial; Tutorial Link

I feel bad and have no real experience in terminal commands other than the simplest version controls. I followed the first link and when trying to run

source ~/.bash_profile 

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

Now every time the terminal loads, an error appears.

Contents of bash_profile;

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

Any guidance is appreciated.

+5
source share
2 answers

It seems that installing rbenv puts the shell script line in your .bash_profile , which is trying to create this directory. You can either give yourself permission 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 
+5
source

This was very useful System Wide Install with rbenv In particular, changing the permissions of the rbenv directory to the group where the users are located:

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

+1
source

All Articles