• No categories


I’m Attending


Installing PostgreSQL on OSX

Posted in: General by Steve on June 19, 2012

While trying to move my development environment from SQLite3 to PostgreSQL, I ran into an issue. Following the instructions from Railscasts #342:

brew install postgresql

Got this error message:

Error: You must `brew link ossp-uuid’ before postgresql can be installed

To fix this, I had to execute the following command:

sudo chown -R whoami /usr/local/share/man/man3

Then I was able to brew install postgresql.

After doing that, I wanted to start my first database by running the command:

initdb /usr/local/var/postgres

This gave me the error:

FATAL: could not create shared memory segment: Cannot allocate memory

To fix this, I had to add a file called /etc/sysctl.conf and add the following lines:


Additionally, I had to add

export PATH=/usr/local/bin:$PATH

to my ~/.bash_profile file

After restarting my machine, I was then able to create the database and move on with moving over to PostgresSQL 



1 Comment
  1. Not sure what is more frustrating, this type of thing or the SQL Server 2008 installer. :-)

    Comment by Steve Schoon on June 20, 2012 at 11:06 am