ec2onrails
What I did to deploy phonehow to my own EC2 instance:
Got setup for EC2 (see proir post).
Installed ec2onrails gem. This has a hard dependency on version 2.4.3 of capistrano. I had to install that version, then uninstall a newer version after ec2onrails complained that the newer version was “activated”.
sudo gem install --version 2.4.3 capistrano # sudo gem uninstall capistrano # if you have any newer versions. sudo gem install ec2onrails
Found out the AMIs of the ec2onrails instances:
cap ec2onrails:ami_ids
32-bit server image for EC2 on Rails 0.9.9: ami-c9bc58a0 64-bit server image for EC2 on Rails 0.9.9: ami-cbbc58a2
ec2-add-keypair samphonehow
cd .ec2 c2-run-instances ami-cbbc58a2 -k samphonehow
Checked I could login to the instance.
Configured capistrano: Edited deploy.rb and inserted my instance-id, url, scm_username, scm_password, keypair, account_id, access_key_id, secret_access_key (from AWS acct identifers page), pk, cert, ssh_options and buckets.
ap ec2onrails:get_public_key_from_server
* executing `ec2onrails:get_public_key_from_server' Your first key in ssh_options[:keys] is /Users/sam/.ec2/id_rsa-samphonehow, presumably that's your EC2 private key. The public key will be copied from the server named 'ec2-75-101-197-239.compute-1.amazonaws.com' and saved locally as /Users/sam/.ec2/id_rsa-samphonehow.pub. Continue? [y/n]
Setup the instance, deployed the app:
cap ec2onrails:setup cap deploy:cold ...lots of output...
And that’s it. The app was up and running.
