Setting Up A Database
We're going to install sqlite3 from homebrew because we can't use the built-in version with macOS Sierra without running into some troubles.
How to install GCC 9.2 on macOS Catalina.If you need to install the Command Line Tools or Homebrew check my previous video tutorial:https://youtu.be/hOx4jwjl0Y.
Rails ships with sqlite3 as the default database. Chances are you won't want to use it because it's stored as a simple file on disk. You'll probably want something more robust like MySQL or PostgreSQL.
There is a lot of documentation on both, so you can just pick one that seems like you'll be more comfortable with.
If you're new to Ruby on Rails or databases in general, I strongly recommend setting up PostgreSQL.
If you're coming from PHP, you may already be familiar with MySQL.
Homebrew complements macOS (or your Linux system). Install your RubyGems with gem and their dependencies with brew. “To install, drag this icon” no more. Homebrew Cask installs macOS apps, fonts and plugins and other non-open source software. $ brew install -cask firefox. Making a cask is as simple as creating a formula. ShawnstationdeMacBook-Pro: shawnstation$ brew -version Homebrew 1.6.9 Homebrew/homebrew-core (git revision fab7d; last commit 2018-07-07) catalina homebrew Share.
MySQL
You can install MySQL server and client from Homebrew:
Once this command is finished, it gives you a couple commands to run. Follow the instructions and run them:
By default the mysql user is root
with no password.
When you're finished, you can skip to the Final Steps.
Homebrew Install Mac Catalina Download
PostgreSQL
You can install PostgreSQL server and client from Homebrew:
Homebrew Install Mac Catalina
Once this command is finished, it gives you a couple commands to run. Follow the instructions and run them:
Install Homebrew Mac Catalina
By default the postgresql user is your current OS X username with no password. For example, my OS X user is named chris
so I can login to postgresql with that username.
Install Homebrew
Paste that in a macOS Terminal or Linux shell prompt.
The script explains what it will do and then pauses before it does it. Read about other installation options.
What Does Homebrew Do?
Homebrew installs the stuff you need that Apple (or your Linux system) didn’t.
Homebrew installs packages to their own directory and then symlinks their files into
/usr/local
.Homebrew won’t install files outside its prefix and you can place a Homebrew installation wherever you like.
It’s all Git and Ruby underneath, so hack away with the knowledge that you can easily revert your modifications and merge upstream updates.
Homebrew complements macOS (or your Linux system). Install your RubyGems with
gem
and their dependencies withbrew
.“To install, drag this icon…” no more. Homebrew Cask installs macOS apps, fonts and plugins and other non-open source software.
Donate to Homebrew
Homebrew Blog
Analytics Data
Homebrew was created by Max Howell. Website by Rémi Prévost, Mike McQuaid and Danielle Lalonde.