Skip to content

Instantly share code, notes, and snippets.

@acuppy
Last active December 26, 2015 02:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acuppy/7079155 to your computer and use it in GitHub Desktop.
Save acuppy/7079155 to your computer and use it in GitHub Desktop.
Setup Ubuntu 12.04 box with Postgres 9.3 and Rails

Setup Rails

  1. cd /vagrant
  2. sudo gem install bundler --no-ri --no-rdoc
  3. \curl -L https://get.rvm.io | bash -s stable --ruby
  4. bundle

Postgres 9.3 onto Ubuntu 12.04

  1. sudo apt-get update
  2. sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison libqt4-dev libxml2-dev libxslt-dev libssl-dev libpq-dev wget git curl
  3. sudo su
  4. cd /usr/local/src && wget http://ftp.postgresql.org/pub/source/v9.3.1/postgresql-9.3.1.tar.bz2
  5. tar -xvf postgresql-9.3.1.tar.bz2
  6. cd ./postgresql-9.3.1
  7. ./configure
  8. make
  9. su
  10. make install
  11. adduser postgres
  12. mkdir /usr/local/pgsql/data
  13. chown postgres /usr/local/pgsql/data
  14. su - postgres
  15. /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
  16. /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
  17. /usr/local/pgsql/bin/psql
  18. update pg_database set datistemplate=false where datname='template1';
  19. drop database Template1;
  20. create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
  21. update pg_database set datistemplate=true where datname='template1';

Setup the database

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