5 ms·
Don't Use the Mac System Ruby
- frenkel 6y agoPart of the argument can be easily circumvented. Have a look at gem install --user and bundle config set --global path. These allow you to install and manage all your gems in your homedir without the need for sudo. I do this all the time in Linux and OpenBSD to use the system ruby.
- DanielKehoe 6y agoI've heard of that but never tried it. I'm curious why you don't use a Ruby version manager.
- frenkel 6y agoI see no benefit. Why is it better than using the package manager I already use for the rest of the programs on my system?
- DanielKehoe 6y agoI always heard this advice but didn’t know why. So I looked into it. Basically, the system Ruby is fine for running sysadmin scripts (as long as you don’t add gems or try to update it). But don’t use it for development because: - the default location for gems is the system Ruby directory /Library/Ruby/Gems/2.6.0 so you will need to be superuser to install gems (and you really shouldn’t alter this folder) - you could use sudo to install gems but that’s a security risk (gem installation can run malicious code) - using Bundler is a best practice to manage gem versions and dependencies - it’s best to start projects with the newest version of Ruby and the system Ruby is 2.6.3 - the pre-installed Ruby is deprecated by Apple and may disappear in future macOS releases Did I miss anything?