brew install postgres
to install Postgres. It might take a little while to compile and install. After compilation is done, it’ll give you some instructions to finish setting it up.initdb
to finish installation of Postgres via Homebrew. Near the end of the installation instructions you should see mention of the command brew services
.brew services
installed. It may be installed withthis command:brew services
to stop it manually:brew services
to restart Postgres:pg
gem:pg
gem in your Gemfile, and runconfig/database.yml
file to point to your Posgres database./usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'
brew update
brew doctor
/usr/local/var/postgres
.initdb
command as shown:pg_ctl -D /usr/local/var/postgres stop
command:initdb