Capistrano を介してローカル マシンから VPS に Rails アプリケーションをデプロイしようとしています。Capistrano を Gemfile に含めて「bundle」を実行することでインストールしました。次に、「capify」を実行しました。ff を Capfile に追加しました。
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :rvm_ruby_string, 'ruby-1.9.2-p136@foobar'
今、私は deploy.rb で立ち往生しています。ファイルにどの値を入れるべきかわかりません。コードを Github または他のオンライン リポジトリでホストしない場合、 set :repository オプションに何を配置すればよいですか? そして、正確に何が設定されていますか:ドメイン? ここで VPS マシンの IP アドレスを使用する必要がありますか? ところで、私は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, "git@github.com: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