로컬 컴퓨터에서 Capistrano를 통해 VPS로 Rails 응용 프로그램을 배포하려고합니다. 나는 그것을 Gemfile에 포함시키고 '번들'을 실행함으로써 Capistrano를 설치했다. 그 다음 나는 달려 들었다. ff를 Capfile에 추가했습니다.로컬 컴퓨터에서 VPS로 Capistrano로 배포
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :rvm_ruby_string, '[email protected]'
지금은 deploy.rb가 붙어있어서 파일에 어떤 값을 넣어야하는지 잘 모르겠습니다. Github 또는 다른 온라인 저장소에서 코드를 호스팅하지 않으면 set : repository 옵션에 무엇을 넣어야합니까? 정확히 무엇이 설정되어 있습니까? 도메인? 여기에 내 VPS 시스템의 IP 주소를 사용해야합니까? Btw, http://infinite-sushi.com/2011/01/deploying-a-rails-app-to-a-linode-box/에서 자습서를 수행 중이며 deploy.rb 샘플이 있습니다.
set :user, 'deploy'
set :domain, 'foo.bar.us'
set :application, "my_web_app"
set :repository, "[email protected]:foo/repo.git" # Your clone URL
set :scm, "git"
set :branch, "master"
set :scm_verbose, true
set :deploy_via, :remote_cache
set :scm_passphrase, "password" # The deploy user's password
set :deploy_to, "/home/#{user}/#{domain}"
set :use_sudo, false
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
role :web, domain # Your HTTP server, Apache/etc
role :app, domain # This may be the same as your `Web` server
role :db, domain, :primary => true # This is where Rails migrations will run
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end
그래서 귀하의 저장소가 로컬로 설정되어 있습니까? –