Skip to content

Instantly share code, notes, and snippets.

@commuterjoy
Created May 17, 2012 14:10
Show Gist options
  • Save commuterjoy/2719165 to your computer and use it in GitHub Desktop.
Save commuterjoy/2719165 to your computer and use it in GitHub Desktop.
Installing Postgres with Rails - what I did

-- install

 brew install postgres
 sudo brew link postgresql

 wget http://download.osgeo.org/proj/proj-4.8.0.tar.gz
 gunzip proj-4.8.0.tar.gz 
 tar -xzvf proj-4.8.0.tar 
 ./configure 
 make
 sudo make install

 brew install postgis

-- run it

 sudo mkdir -p /usr/local/pgsql/data
 chown chadbm01 /usr/local/pgsql/data
 initdb -D /usr/local/pgsql/data
 postgres -D /usr/local/pgsql/data

-- add a 'root' user

 psql template1

 template1=# CREATE USER root WITH PASSWORD '';
 template1=# ALTER USER root CREATEDB;
 template1=# \q

-- rails

 rake db:drop
 rake db:create
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment