Spent the weekend trying to set up a good AMI I can use to deploy small applications. I haven’t done a real side project in way too long, and last time I tried I found myself extremely frustrated with shared hosting / passenger (don’t even), Heroku (asset pipeline?), and Engine Yard (rails 3?). In forging my own way, I took far too long to debug the following simple issues:

  1. The ruby binary doesn’t change when you install ruby 1.9.2 Simple fix here, the ruby binary in /usr/bin/ruby is a symlink to /etc/alternatives/ruby which itself is a symlink to /usr/bin/ruby1.8. I changed /etc/alternatives/ruby to point to /usr/bin/ruby1.9.1
  2. Thin doesn’t have any of the gems I carefully installed. That’s because thin (the one you get from apt-get install thin anyway) has an init script that uses #!/usr/bin/ruby1.8 . GRAH WHY?! Anyway, change that line to #!/usr/bin/ruby and install a 1.9.1 compatible version of thin. All should be well.
  3. Make sure no two thin yaml config files point to the same ports, otherwise they will conflict. And whichever goes first alphabetically will end up snaring the port range.

Everything else was pretty obvious - whenever something was missing, install it, get users set up, authorize keys, setup Capistrano, etc.

Anyway, good luck if you’re using Ubuntu / rails 3 / etc on S3. So far so smooth from here.