Installing Ruby on Rails


#1

Hello

I am currently on this page of the Web Development course:
https://www.theodinproject.com/courses/web-development-101/lessons/your-first-rails-application?ref=lnav

I am on the step where it asks me to install Ruby on Rails using:
gem install rails -v 5.2.3

I get this on my terminal:
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

What can I do?


#2

What OS are you using?


#3

macOS


#4

It means rbenv isn’t setting the ruby version but the system installed ruby is still doing it.

Run curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash in your terminal and let me know the output.


#5

I’ve got the same problem. I’ve run curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash

And the output is as follows:

Checking for rbenv' in PATH: /usr/local/bin/rbenv Checking for rbenv shims in PATH: not found The directory/Users/dalijimmysoh/.rbenv/shims’ must be present in PATH for rbenv to work.
Please run `rbenv init’ and follow the instructions.

Checking `rbenv install’ support: /usr/local/bin/rbenv-install (ruby-build 20200224)
Counting installed Ruby versions: 1 versions
Checking RubyGems settings: OK
Auditing installed plugins: OK