ruby on rails - Capistrano error when using git -
i trying setup capistrano , want test config locally before testing on server, when run cap deploy -n keep getting following error relating 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' nil:nilclass (nomethoderror)
and leading follows:
* 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 * executing "rm -rf /u/apps/app_name/releases/20130826161230; true"
i have tried trace back, can't seem figure out causing it. deploy.rb looks follows:
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 choose branch in command line or default master 'cap -s branch=branchname deploy' set :branch, fetch(:branch, "master") #tells resuse 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 using passenger mod_rails uncomment this: namespace :deploy task :start ; end task :stop ; end task :restart, :roles => :app, :except => { :no_release => true } run "#{try_sudo} touch #{file.join(current_path,'tmp','restart.txt')}" end end
has else experienced error? found this post following 1 suggestion not change error @ all.
the issue appears when in dry run mode run_locally function returns array, not expected string.
see https://github.com/capistrano/capistrano/blob/legacy-v2/lib/capistrano/recipes/deploy.rb#l133
not sure if there easy way git recipe figure out in dry run mode. if hack in this:
# in recipes/deploy/scm/git.rb ~line 229 result = yield(command) return "666" if result.class == array # better be: dry_run?
then -n invocation continues.
Comments
Post a Comment