Skip to content

Instantly share code, notes, and snippets.

@alexagui
Created June 29, 2012 01:18
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexagui/3015100 to your computer and use it in GitHub Desktop.
Save alexagui/3015100 to your computer and use it in GitHub Desktop.
Migrate a Rails project to Postgresql with Postgres.app and Induction

I had issues installing Postgres with the instructions in this Railscast. However I was able to get postgres running on my project with http://postgresapp.com/ and http://inductionapp.com/ (Hat tip to this stackoverflow thread).

  1. Download & install Postgres.app (documentation) Make sure to install in /Applications.
  2. Update your PATH
    In my case I added the following to ~/.bash_profile
    export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
    Check that Postgres.app is being loaded
$ which psql
/Applications/Postgres.app/Contents/MacOS/bin/psql
  1. Update /config/database.yml
development:   
     adapter: postgresql   
     encoding: unicode   
     database: myapp_development   
     pool: 5   
     host: localhost   
  1. bundle exec rake db:create:all
  2. I'm hosting my app on Heroku so then ran a heroku db:pull
  3. Download & install Induction.
  4. Launch Induction and connect using these settings.
    NOTE Select the last postgres option in Adapter drop down
Adapter     postgres
Hostname    localhost
Username    [I left this blank]
Password    [I left this blank]
Port        5432
Database    [I left this blank]
  1. Once Induction launches you can select your app's database from list in top left dropdown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment