Skip to content

Instantly share code, notes, and snippets.

@alex-zige
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex-zige/101751fc92d1410b65b8 to your computer and use it in GitHub Desktop.
Save alex-zige/101751fc92d1410b65b8 to your computer and use it in GitHub Desktop.
Rails 4 + Postgres + opsworks

##Create RDS with postgres

Opsworks has a bug, even you registerd a postgres RDS, the adapter is still using 'mysql'

WORKAROUND:

##Create mysql layer (fake) don't assign instances

##Use custom Stack JSON

*Be careful with adapter

{
  "deploy": {    
    "ticket_to_paradise": {
      "database": {
        "adapter": "postgis", 
        "encoding": "utf8",
        "host": "your-host",
        "port": "5432",
        "database": "attp_db_2",
        "pool": "5",
        "username": "your-password",
        "password": "your-username",
      }
    }
  }
}

##Add missing postgres package In OS package, Add postgresql93-devel

##Add security group -> opsworks-rails-layer.

Enable postgis extension

###login into psql

psql -h <host> -p <port> -u <database>

##Then db:migrate and db:seed

If you created your db before. time to drop it and recreate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment