Skip to content

Instantly share code, notes, and snippets.

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 augmen/9a001fd5358782902942 to your computer and use it in GitHub Desktop.
Save augmen/9a001fd5358782902942 to your computer and use it in GitHub Desktop.
# assumptions: virtualbox, vagrant already installed
# and there is a box lucid32
1. rails new appdmeo , gem capistrano , then bundle
2. vagrant init lucid32
3. capify .
# !important
# vagrant ssh-config >> ~/.ssh/config
# vagrant ssh-config | grep IdentityFile | awk '{print $2}' that's where private key located
# then change the file's(~/.ssh/config) first line "host localhost" to "host vagrant"
# then modify deploy.rb:
set :application, "capdemo"
set :scm, :none
set :repository, "."
set :local_repository, "."
server 'vagrant', :web, :app, :db
set :user, "vagrant"
set :use_sudo, false
set :deploy_to, "/home/#{user}/apps"
set :deploy_via, :copy
set :copy_exclude, "log/*"
4. cap deploy:setup
5. ssh to your vagrant box , you'll find the deployed app location in /home/vagrant/apps
ssh vagrant or vagrant ssh , both are ok now , because in ~/.ssh/confg there is a config file we copyed from vagrant ssh-config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment