Resolve Gem :: FilePermissionError when running gem install rails (Rails Tutorial Chapter 1)

Keep track of any errors that occur as you progress through the rails tutorial. The hardware uses MacBook Air, and the development environment uses VScode.

rails tutorial Chapter 1 1.2.2 Install Rails

2020.7 Currently, rails6 is the latest version, but the free version of the rails tutorial is compatible with rails5, so install rails5.

** Ruby is installed using the gem command. ** **

$ gem install rails -v 5.1.6

As for where to run gem install, I ran it in my home directory. (You can move it by running $ cd ~ or cd.) After a lot of research, I couldn't find an article that describes where to run: sob:

** Naturally the engineer knows?

Going back, when I run the command above, I get the following error:

$ gem install rails -v 5.1.6

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

This is ** not authorized! The error is **.

MacOS has the ability to not allow any material changes to the system other than those who are authorized as administrators. An error has occurred because it has been blocked by this.

So add a command called ** sudo. ** **

$ sudo gem install rails -v 5.1.6

When the ** sudo command ** determines whether the user who executed the command ** has administrator privileges (whether the account has a password set) ** and has administrator privileges. , The command is executed.

At that time, you will be asked to enter the password, so ** Enter the password for logging in to your computer. ** **


The installation is completed successfully!

If you find it useful, I would be grateful if you could click the ** LGTM button. ** ** Let's do our best to learn Rails together! : raised_hand_tone1:

Recommended Posts

Resolve Gem :: FilePermissionError when running gem install rails (Rails Tutorial Chapter 1)
Resolve ActiveRecord :: NoDatabaseError when doing rails test (Rails tutorial Chapter 3)
rails tutorial Chapter 6
rails tutorial Chapter 1
rails tutorial Chapter 7
rails tutorial Chapter 5
rails tutorial Chapter 10
rails tutorial Chapter 9
rails tutorial Chapter 8
Error in bundle install when running rails new
Rails Tutorial Chapter 5 Notes
Rails Tutorial Chapter 10 Notes
Rails Tutorial Chapter 3 Notes
Rails Tutorial Chapter 3 Learning
Rails Tutorial Memorandum (Chapter 3, 3.1)
Rails Tutorial Chapter 4 Notes
Rails Tutorial Chapter 4 Learning
Rails Tutorial Chapter 1 Learning
Rails Tutorial Chapter 2 Learning
Rails Tutorial Chapter 8 Notes
Rails Tutorial Memorandum (Chapter 3, 3.3.2)
Ruby on Rails Tutorial Troublesome notes when running on Windows
[Rails Tutorial Chapter 4] Rails-flavored Ruby
Resolve Gem :: FilePermissionError from nokogiri error caused by bundle install
[Rails Struggle/Rails Tutorial] Summary of Rails Tutorial Chapter 2
[Rails Tutorial Chapter 5] Create a layout
rails tutorial chapter 10 summary (for self-learning)
Chewing Rails Tutorial [Chapter 2 Toy Application]
Rails Tutorial (4th Edition) Memo Chapter 6
Rails Tutorial 6th Edition Learning Summary Chapter 10
Rails Tutorial 6th Edition Learning Summary Chapter 7
Rails Tutorial 6th Edition Learning Summary Chapter 4
Rails Tutorial 6th Edition Learning Summary Chapter 9
Rails Tutorial 6th Edition Learning Summary Chapter 6
Rails Tutorial 6th Edition Learning Summary Chapter 5
How to resolve errors when installing Rails 5.1.3
Rails Tutorial 6th Edition Learning Summary Chapter 2
Rails Tutorial Chapter 0: Preliminary Basic Knowledge Learning 5
Rails Tutorial 6th Edition Learning Summary Chapter 3
Rails Tutorial 6th Edition Learning Summary Chapter 8
Decompose "$ printf" install: --no-document \ nupdate: --no-document \ n ">> ~ / .gemrc" in Chapter 1 of the Rails Tutorial
rails tutorial
rails tutorial
rails tutorial
rails tutorial
rails tutorial
rails tutorial
rails tutorial
[Rails Struggle/Rails Tutorial] What you learned in Rails Tutorial Chapter 6
[Rails Struggle/Rails Tutorial] What you learned in Rails Tutorial Chapter 3
Rails Tutorial Chapter 1 From Zero to Deployment [Try]
Chewing Rails Tutorial [Chapter 3 Creating Almost Static Pages]
[Rails tutorial] A memorandum of "Chapter 11 Account Activation"
I can't deploy! Resolve an error that can't be pushed to heroku (Rails Tutorial Chapter 1)
Resolve LoadError (cannot load such file --bcrypt) that occurs in rails test (Rails tutorial Chapter 6)