假設 bitnami Rails stack 安裝好在 ec2
remote ec2 server
make sure you can
ssh host_name connect to your remote server.
ssh-add key.pem if neccessary.
Install capistrano, then in your local application dir
# in your config/deploy.rb
one more thing:
git remote add ec2 host_name:/home/bitnami/apps/myapp
ok, let's deploy,
git push ec2 master # dont forget push first
Gone for this far, theoretically it should be easy for the rest. However, by my experiences, it's still highly possible to get stucked in any step by any kind of errors.
A command problem might be the shell environment. On one linux machine, there might be different shell environments, sh, bash, cth, ..etc, and different shell environments usually corresponding to different rvm/ruby/rails paths. To solve this problem, one may want to decide the shell environment you want to use in deployment.
By default, capistrano use sh. If you don't want it be your choice, set false in your deploy.rb, ref here:
default_run_options[:shell] = false
or you can specify your favorite, ref here :
default_run_options[:shell] = '/bin/bash' # I haven't test this yet
Once into your favorite shell, there might still be different rvm loading path. Try this, it works for me, ref here:
set :bundle_cmd, 'source $HOME/.bash_profile && bundle'