Skip to content

Instantly share code, notes, and snippets.

@iandouglas
Created September 7, 2018 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iandouglas/53c6babc68647154482a3115ce2b5878 to your computer and use it in GitHub Desktop.
Save iandouglas/53c6babc68647154482a3115ce2b5878 to your computer and use it in GitHub Desktop.
mcOS X High Sierra, Rails and PostgreSQL installation notes

The "High Sierra" build of macOS X removed a legacy folder path where some library files are generally installed for tools that need to be compiled. If you click on the 'apple' icon in the top left corner of your screen, if the text in large font says something like "macOS High Sierra" then this set of instructions could help fix some problems for you.

If you have installed PostgreSQL before upgrading to High Sierra, this may not affect you and these installation notes may not help.

If your Macbook came with High Sierra, or you've upgraded to High Sierra before installing PostgreSQL, this may affect you and you can keep reading.

Assumptions:

  • you're using Homebrew

At a high level, we're going to uninstall PostgreSQL, set up this legacy path, re-install PostgreSQL and then install the PostgreSQL gem for Ruby.

  1. Uninstall PostgreSQL
brew uninstall postgresql

This should not delete any existing databases, especially if you're using Homebrew, it will only remove the binary files of the PostgreSQL software itself.

  1. Create the legacy path and set its ownership
sudo mkdir /usr/local/include
sudo chown -R `whoami`: /usr/local/include
  1. Re-install PostgreSQL
brew install postgresql
brew services start postgresql
  1. Install the "pg" gem
gem install pg -v 0.21.0
@audez
Copy link

audez commented Oct 25, 2022

this saved me thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment