Write permissions


I’m having trouble installing rails
I followed every step of the web dev 101 up to the part where it install rails but when I put the command “gem install rails” the output is:

ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /var/lib/gems/2.5.0 directory.

what I might have done wrong and what can I do to repair it?
I’ve been trying for a couple hours now, even restarted the instalation of both rbenv and ruby but nothing seems to work

EDIT: I believe this is not right, right?

input: $ rbenv -v
output: rbenv 1.0.0


Have you tried restarting your terminal?


yes, that was one of the first things I tried
I believe my problem is within de rbenv, but I don’t know for sure


It looks like you installed rbenv using sudo. You need to go back and follow the instructions to install rbenv properly or you’ll keep having problems.


I did it four times, but in the fifth it worked
thanks for the feedback! :smile: