Getting Started with Ruby on MacOS

<p>If you&rsquo;re starting out with Ruby or Ruby on Rails development, you&rsquo;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&rsquo;t conflict with&nbsp;<code>brew</code>&nbsp;or an existing install of Ruby 2.7 Mac</li> </ol> <p>In this tutorial, you&rsquo;ll learn how to do both! If you have the new macOS M1 laptops, don&rsquo;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&nbsp;<code>brew install ruby</code>&nbsp;or updating your existing Ruby versions on a macOS by running the&nbsp;<code>update ruby mac</code>&nbsp;command. I highly recommend you avoid that completely.</p> <p>That said, Reddit user&nbsp;<em>postmodern</em>&nbsp;<a href="https://www.reddit.com/r/ruby/comments/xpd6ji/comment/iq67nad/?utm_source=reddit&amp;utm_medium=web2x&amp;context=3" rel="noopener ugc nofollow" target="_blank"><strong>shared on a Ruby thread</strong></a>&nbsp;that you could probably instruct the&nbsp;<code>brew</code>&nbsp;installation to be explicitly installed onto a different directory. Brew by default installs to&nbsp;<code>/usr/local</code>&nbsp;and according to&nbsp;<em>postmodern</em>, this doesn&rsquo;t interfere with the Apple system Ruby scripts because their interpreter location is hardcoded to&nbsp;<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>
Tags: Ruby macOS