Upgrade Ruby to the latest version under Mac
I found that the version of ruby is too low when installing other software. Now I am preparing to upgrade Xia ruby.
View ruby version
Command: ruby --version
Prompt version is as follows, it should be upgraded:
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
Upgrade ruby
Inquiry online using brew method
Command: brew install ruby
At this point, you will be prompted as follows, upgrade Homebrew first, and then a long waiting process, you can drink saliva and wait for a while.
After the installation is complete, execute the command to check the version and find that it is still 2.0.0. The version has not changed. You should also set environment variables through Baidu.
Setting environment variables
Open the file: vi .bashrc
Enter the following: export PATH = / usr / local / Cellar / ruby / 2.5.1 / bin: $ PATH
Execute the import command: source .bashrc
Check the version again
ruby --version
The message is as follows, and you're done:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin14]
Upgrade Ruby to the latest version on Mac
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service