カピストラーノをセットアップしようとしていて、サーバーでテストする前に構成をローカルでテストしたいのですが、 cap deploy -n を実行すると、git に関連する次のエラーが発生し続けます
/Users/josh/.rvm/gems/ruby-1.9.3-p448@wgbh/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/scm/git.rb:234:in `block in query_revision': undefined method `sub' for nil:NilClass (NoMethodError)
そして、次のようにこれに至るまで:
* 2013-08-26 12:12:30 executing `deploy'
* 2013-08-26 12:12:30 executing `deploy:update'
** transaction: start
* 2013-08-26 12:12:30 executing `deploy:update_code'
* executing locally: "git ls-remote git@github.com:GIT_REPO GIT_BRANCH"
*** [deploy:update_code] rolling back
* executing "rm -rf /u/apps/APP_NAME/releases/20130826161230; true"
これをさかのぼって追跡しようとしましたが、何が原因なのかわかりません。私の deploy.rb は次のようになります。
require "bundler/capistrano"
set :application, "APP_NAME"
set :deply_to, "/the/server/path"
set :user, "SERVER_USER"
set :repository, "git@github.com:GIT_REPO_PATH"
set :scm, :git
set :scm_username , "GIT_USER_NAME"
#this allows you to choose a branch in the command line or default to master with 'cap -S branch=branchname deploy'
set :branch, fetch(:branch, "master")
#tells is to do resuse a single remote git clone
set :deploy_via, :remote_cache
server "THE_SERVER_NAME", :app, :web, :db, :primary => true
after 'deploy:update_code', 'deploy:migrate'
# If you are using Passenger mod_rails uncomment this:
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
他の誰かがこのエラーを経験しましたか? この投稿を見つけましたが、1 つの提案に従ってもエラーはまったく変わりません。