Cheap VPS host selection
Provide server host evaluation information

How to install ruby on mac (Mac installation of ruby tutorial)

1. Use homebrew to install rbenv

 brew install rbenv

2. Explanation of common commands

 rbenv install -- list  #List all ruby versions rbenv install two . zero -p247 #Install the required ruby version rbenv versions #All installed ruby versions rbenv global  one point eight . seven -p352 #Set global ruby version rbenv local one point nine . seven  #Set the ruby version of the current folder rbenv uninstall two  #Uninstall the specified ruby version

3. Install ruby

 rbenv install two point seven . zero

After the installation is successful, we make it effective in the local environment:

 rbenv shell two point seven . zero

An error may be reported after the above command is entered. Rbenv prompts us to add a line of eval "$(rbenv init -)" statement in. zshrc to initialize the rbenv environment. If an error is reported, we can add and restart the terminal.

 $ ruby -v       ruby two point seven .0p0 ( two thousand and nineteen - twelve - twenty-five revision 647ee6f091) [x86_64-darwin20] $ which ruby /Users/lee980/.rbenv/shims/ruby
Do not reprint without permission: Cheap VPS evaluation » How to install ruby on mac (Mac installation of ruby tutorial)