Help installing Rails/Bundler


#1

Hi guys.

So I’ve been having troubles with setting up this whole thing. When trying to install rails an error saying “gem command wasn’t found” kept popping up and suggested I tried sudo to install instead.

Now when trying to do install gem rails or bundle, it shows a file permission error. Has this come up to you? Haven’t found an answer on Google (I think I’m not formulating my question good enough).

Thanks in advance!


#2

Hi @misselliev

You shouldn’t use sudo to install gems.

If you could please copy the entire error message you get then we’ll be able to assist.


#3

I typed gem install rails and then it says:

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


#4

Hey @misselliev

It looks like you’ve installed rbenv using sudo which is going to cause you problems down the line.

What OS are you using?


#5

@CouchofTomato win 10 using WSL.


#6

What’s the output of rbenv version and ruby -v in your terminal?


#7

For rbenv I get:
Command ‘rbenv’ not found but can be installed with sudo apt install rbenv

And for ruby -v:
Ruby 2.5.1p57 (2018-03-09 revision 63029)[x86_64-linux-gnu]


#8

Yeah, it looks like rbenv hasn’t been installed properly.

The installations page has recently been updated to be clearer to I would go back and follow through that and ensure you get rbenv installed properly to manage your ruby versions. If you run into any issues then let us know.


#9

Ok I’ll check it out. Thank you so much!