Getting Started with Ruby on MacOS
<p>If you’re starting out with Ruby or Ruby on Rails development, you’ll want to know:</p>
<ol>
<li>How to properly install Ruby on Mac.</li>
<li>How to setup a local development environment that doesn’t conflict with <code>brew</code> or an existing install of Ruby 2.7 Mac</li>
</ol>
<p>In this tutorial, you’ll learn how to do both! If you have the new macOS M1 laptops, don’t worry, this tutorial also works for installing Ruby on Mac M1.</p>
<h1>Never run brew install ruby</h1>
<p>Some guides and blog articles will instruct you to install Ruby by running <code>brew install ruby</code> or updating your existing Ruby versions on a macOS by running the <code>update ruby mac</code> command. I highly recommend you avoid that completely.</p>
<p>That said, Reddit user <em>postmodern</em> <a href="https://www.reddit.com/r/ruby/comments/xpd6ji/comment/iq67nad/?utm_source=reddit&utm_medium=web2x&context=3" rel="noopener ugc nofollow" target="_blank"><strong>shared on a Ruby thread</strong></a> that you could probably instruct the <code>brew</code> installation to be explicitly installed onto a different directory. Brew by default installs to <code>/usr/local</code> and according to <em>postmodern</em>, this doesn’t interfere with the Apple system Ruby scripts because their interpreter location is hardcoded to <code>/usr/bin/ruby</code>.</p>
<p><a href="https://medium.com/web3-use-case/getting-started-with-ruby-on-macos-a4d78e633e11"><strong>Website</strong></a></p>