I'm back onto server setup on AWS and this time I have to setup a Rails application running on an EC2 instance. After a bit of searching I came across rubber to help automate the process and followed along with a Railscast to understand the process better. It looked straightforward but when I got into it there where a few issues and a bit of work needed to use it in production.
I've recently had to setup an existing Ruby on Rails application to run on Amazon Beanstalk. The application uses a PostgreSQL database but also needed support for PostGIS which is a spatial database extender for a PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL. It has taken me quite a while to get the application up and running so I thought it would be a good idea to document the whole process here to hopefully help others (and myself when I need to setup another application on Beanstalk!).
I'm pretty much a total newbie to setting up servers so I'd really appreciate tips on how to automate the steps below to speed up the process.
A lot of the information came from this post which helped me no end for setting up my API. I'll add a bit more detail in this post to help explain some of the settings and I needed to do quite a bit of reading to understand it all. My intention is to build a Rails API and then build a separate React.js frontend to consume that API. In this post I'll just discuss the setting up of the Rails API but may write a post later about React.
I want to make a quick post about a new Rails method, delegate, that I came across recently. It's a really useful way to refactor code in order to cut down on the number of public object methods that you have to explicitly define. You can read the documentation for the delegate method here