guarinogabriel / Mac-CLI

 macOS command line tool for developers – The ultimate tool to manage your Mac. It provides a huge set of command line commands that automatize the usage of your Mac.
MIT License
8.86k stars 334 forks source link

"sudo gem update --system" and "sudo gem update" causes problem with rbenv/RVM installed #148

Closed lebensterben closed 3 years ago

lebensterben commented 6 years ago

Hi,

I found that after the first successful "mac update" operation, it always fails at "sudo gem update --system" and "sudo gem update". I found that it could be manually fixed by reinstalling those gems with "gem install XXX --user-install" and "mac update" would work for once and the same problem came back. ( Though gem update --system always fails.)

I later found out that this is due to that I replaced the system-ruby (version 2.3.x) with the one I installed with "rbenv". And it turns out that if "rbenv" or "RVM" is used, it would broke the ruby installation if sudo is used during upgrades.

An upgrade to mac-cli is needed s.t. during the original installation, the script should check whether rbenv/RVM is used and prompt to ask the user whether to elevate the privilege with sudo command during updates. And for existing users, there need to be an option in /usr/local/bin/mac file s.t. they could specify whether sudo is used or not.

Thanks.

ThatLurker commented 6 years ago

Is there a need to ask for sudo if rbenv/RVM is used?