Problem Installing Rails


#1

Could anyone help me with installing rails? I’m on Step 2 of the “Your First Rails Application.” When I type in gem install rails I get the following message:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

In the previous lesson, I had followed the steps an entered the following commands:
rbenv install 2.5.3 --verbose and rbenv global 2.5.3

But when I type ruby -v I get the message: ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

Also, I don’t know if this effects anything, but I’m using Iterm2 on a Macbook Pro


#2

Are you using rbenv to install your rubies?

What are the contents of your ~/.bashrc or ~/.bash_profile files?


#3

Sorry, rookie here. How do I access those files? I typed them in but it says zsh: no such file or directory


#4

Did you follow the installfest instructions?


#5

I just followed all the instructions in the “Installations” section of TOP. I just tried it again and one thing I did notice is that instead of saying

# Load rbenv automatically by appending 
# the following to ~/.bash_profile: 

it says

# Load rbenv automatically by appending 
# the following to ~/.zshrc: 

So in the next line (echo 'eval "$(rbenv init -)"' >> ~/.bash_profile), I tried replacing the ~/.bash_profile part with ~/.zshrc, but still no luck


#6

If you are using zsh you will need to do the following

It gives you the line to add to your zshrc. That should get you going.


#7

Thank you very much. Everything works fine now.