antranapp / blog

AnTran.App: #Swift #Kotlin #MachineLearning #Minimalism
https://antran.app
MIT License
0 stars 0 forks source link

How to install the latest ruby version on M1/M1 Pro/M1 Max Macs? | An Tran #8

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

How to install the latest ruby version on M1/M1 Pro/M1 Max Macs? | An Tran

How to install the latest ruby version on M1/M1 Pro/M1 Max Macs?

https://antran.app/2021/m1_mac_part2/

nadunperera commented 2 years ago

Hi, Thank you for this.

Quick question, How do you unset the global version to previous?

ponessa commented 1 year ago

Thanks!

jensen-tsi commented 1 year ago

Good day, I am new to M1. Upon running rbenv init I get env: bash: No such file or directory. I am sure that rbenv was installed as running install command again will throw

Warning: rbenv 1.2.0 is already installed and up-to-date.
To reinstall 1.2.0, run:
  brew reinstall rbenv
antranapp commented 1 year ago

I believe in the newest macOS, zsh has replaced bash as default shell.

I have added this line eval "$(rbenv init - zsh)" into my ~/.zshrc.

Maybe that's something you can try as well.

AhmdYASSERyassir commented 1 year ago

isn't changing the global version of ruby may ruin the os itself?

azavatonecog commented 1 year ago

MacOS 12.4. At the build stage of Ruby 3.0.3 and 3.2.1, there is a build error in openSSL. ruby-build: using gmp from homebrew,

compiling psych_emitter.c compiling readline.c compiling limits.c compiling ripper.c readline.c:1904:37: error: use of undeclared identifier 'username_completion_function'; did you mean 'rl_username_completion_function'? rl_username_completion_function); ^~~~~~~ rl_username_completion_function readline.c:79:42: note: expanded from macro 'rl_username_completion_function'

define rl_username_completion_function username_completion_function

                                     ^

/usr/local/opt/readline/include/readline/readline.h:494:14: note: 'rl_username_completion_function' declared here extern char rl_username_completion_function (const char , int); ^

thinhtt264 commented 1 year ago

pc220901@PC220901s-Mac-mini Personal % rbenv install 2.7.6 rbenv: /Users/pc220901/.rbenv/versions/2.7.6 already exists continue with installation? (y/N) n pc220901@PC220901s-Mac-mini Personal % rbenv global 2.7.6 pc220901@PC220901s-Mac-mini Personal % rbenv global 2.7.6 pc220901@PC220901s-Mac-mini Personal % cd .. pc220901@PC220901s-Mac-mini Desktop % rbenv global 2.7.6 pc220901@PC220901s-Mac-mini Desktop % ruby -v ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]

please help me, why cant i update ruby ver ?

azavatonecog commented 1 year ago

Skip the Ruby install. Do the install of Cocoapods through Brew.


From: Trương Tiến Thịnh @.> Sent: Tuesday, March 7, 2023 4:48 AM To: antranapp/blog @.> Cc: Zavatone, Alexander (Cognizant) @.>; Comment @.> Subject: Re: [antranapp/blog] How to install the latest ruby version on M1/M1 Pro/M1 Max Macs? | An Tran (Issue #8)

CAUTION: External Email

@. Personal % rbenv install 2.7.6 rbenv: /Users/pc220901/.rbenv/versions/2.7.6 already exists continue with installation? (y/N) n @. Personal % rbenv global 2.7.6 @. Personal % rbenv global 2.7.6 @. Personal % cd .. @. Desktop % rbenv global 2.7.6 @. Desktop % ruby -v ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]

please help me, why cant i update ruby ver ?

— Reply to this email directly, view it on GitHubhttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fantranapp%2Fblog%2Fissues%2F8%23issuecomment-1457952655&data=05%7C01%7Calexander.zavatone%40cognizant.com%7C886bee0433454a7c533a08db1ef97fee%7Cde08c40719b9427d9fe8edf254300ca7%7C0%7C0%7C638137829194695264%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CtITyR7Rbd0kVpqUt622mzcb1Zs%2BVRV30rDjx2wG%2F2o%3D&reserved=0, or unsubscribehttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAZ7GMYDX4JXUX2TLCTKUTITW24HABANCNFSM55KZVU5Q&data=05%7C01%7Calexander.zavatone%40cognizant.com%7C886bee0433454a7c533a08db1ef97fee%7Cde08c40719b9427d9fe8edf254300ca7%7C0%7C0%7C638137829194695264%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=n%2FW6IRO0hYGO%2FXx8ni22400iHlhmUeL5YsPu1HB3Tvs%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>

This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.

taillades commented 1 year ago

Thanks for this, this is super useful!

ucals commented 8 months ago

This was useful, but it didn't work. After rbenv global, I had to run rbenv rehash to force the system to recognize the new ruby as the default.

sd4483 commented 3 months ago

If anyone is not able to set the latest installed ruby version as default even after running rbenv global ..., run rbenv rehash after running rbenv global ...

Thanks to @ucals for pointing this out!!

varmiguemunoz commented 1 month ago

Hey guysss, It doesn't work. The default ruby version is still there, even after run rbenv rehash command line. Anyone can help me? My macbook is a Macbook Air M1, arm64.