General

Categories

  • No categories

SEARCH

I’m Attending

CodeMash

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:

kern.sysv.shmall=65536
kern.sysv.shmmax=16777216

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 

REF:

https://github.com/mxcl/homebrew/issues/11427

https://gist.github.com/2794006

http://jeffammons.net/2011/09/fixing-postgres-on-mac-10-7-tiger-for-django/

Comments

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