Skip to content

Instantly share code, notes, and snippets.

@wrburgess
Created April 28, 2012 18:57
Show Gist options
  • Select an option

  • Save wrburgess/2521308 to your computer and use it in GitHub Desktop.

Select an option

Save wrburgess/2521308 to your computer and use it in GitHub Desktop.
Notes on Installing PostgreSQL from RailsCasts

#Notes on Installing PostgreSQL from RailsCasts

##References

##Steps command to check version

psql --version

command to install

brew install postgresql

command to setup

initdb /usr/local/var/postgres

command to start server

pg_ctl -D /user/local/var/postgres -l logfile start

##Errors

###Error Message: Could not create shared memory segment: Cannot allocate memory

In your terminal, reset memory allocation

$ sudo sysctl -w kern.sysv.shmall=65536
$ sudo sysctl -w kern.sysv.shmmax=16777216

###Error: System refers to /usr/bin/psql directory

In your terminal, test with:

which psql
probably says: /usr/bin/psql

Add this line to your ~/.bash_profile:

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

In terminal refresh with:

source ~/.bash_profile

Now, a quick "which psql" should say:

/usr/local/bin/psql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment