I'm a newbie, so apologies if this is a silly question, but can anyone help me decipher this deploy error? I've finally managed to get 'cap deploy:setup' and 'cap deploy:check' to run without errors. Now, I'm stuck at 'cap deploy:update'. Judging from the error output, it looks like there's a problem with my deploy file, but I have no idea what the problem might be. The shell output and deploy file are below. Any help would be very much appreciated!
Some background: I'm deploying to a friend's server which is running passenger. We're using ruby 1.9.2-p290, rails 3.1.3, capistrano 2.11.2, and MacOS 10.6.
Here's a sample of the deploy error output:
my-MacBook-Pro:projectfolder myuser$ cap deploy:update
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote ssh://git#server.example.ca/usr/local/git_root/arbiterapi.git master"
*** [deploy:update_code] rolling back
* executing "rm -rf /usr/local/www/sites/project.example.ca/releases/20120330191423; true"
servers: ["project.example.ca"]
[project.example.ca] executing command
[project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'ruby-1.9.2-p290#project' -c 'rm -rf /usr/local/www/sites/project.example.ca/releases/20120330191423; true'
command finished in 663ms
/Users/myuser/.rvm/gems/ruby-1.9.2-p290#project/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy.rb:107:in ``': No such file or directory - git ls-remote ssh://git#server.example.ca/usr/local/git_root/project.git master (Errno::ENOENT)
from /Users/myuser/.rvm/gems/ruby-1.9.2-p290#project/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy.rb:107:in `block in run_locally'
from /Users/myuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
from /Users/myuser/.rvm/gems/ruby-1.9.2-p290#project/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy.rb:106:in `run_locally'
from /Users/myuser/.rvm/gems/ruby-1.9.2-p290#project/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy.rb:44:in `block (3 levels) in load'
from /Users/myuser/.rvm/gems/ruby-1.9.2-p290#project/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy.rb:96:in `with_env'
from /Users/myuser/.rvm/gems/ruby-1.9.2-p290#project/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy.rb:44:in `block (2 levels) in load'
from /Users/myuser/.rvm/gems/ruby-1.9.2-p290#project/gems/capistrano-2.11.2/lib/capistrano/recipes/deploy/scm/git.rb:227:in `query_revision'
... etc.
The rest of the error output points to the capistrano folder as well. The output seems too long to include in its entirety. But I can provide the rest if it might help!
Here's the deploy file:
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :application, "Project"
set :scm, "git"
set :repository, "ssh://git#server.example.ca/usr/local/git_root/project.git"
set :user, "deploy"
#set :rvm_bin_path, "/usr/local/rvm/bin"
set :rvm_ruby_string, "ruby-1.9.2-p290#project"
set :normalize_asset_timestamps, false
ssh_options[:forward_agent] = false
set :branch, "master"
set :deploy_via, :remote_cache
set :deploy_to, "/usr/local/www/sites/project.example.ca/"
set :use_sudo, false
set :domain, 'project.example.ca'
role :app, domain
role :web, domain
role :db, domain, :primary => true
The error is the line
No such file or directory - git ls-remote ssh://git#server.example.ca/usr/local/git_root/project.git master (Errno::ENOENT)
So it is failing at checkout out the repository. Why do you have the ssh prefix? When specifying a user (git#), you shouldn't have a protocol as well - the repository should just be set to
git#server.example.ca/usr/local/git_root/project.git
or whatever the actual URL is for git repository for the project.
FYI - neither deploy:setup nor deploy:check actually checkout the code, which is why those two work.
Related
I've been looking at a way to deploy my app using capistrano. I currently am hosting a small private repo on github and a local server to try deploying my test. I come upon a problem and an error message below.
I have done the following
Generate an ssh key on server and added it sucessfully to deploy keys in repo and tested(git#github.com)
Generate an ssh key on client and add it sucessfully to deploy keys in repo
setup a private repository. And have account deployer with rights to deploy
configed deploy.rb and production rb to follow mimic many other templates out there.
I still cannnot figure why it is giving me an error like this
DEBUG [a5554d3d] Command: /usr/bin/env chmod +x /tmp/App/git-ssh.sh
INFO [a5554d3d] Finished in 0.020 seconds with exit status 0 (successful).
INFO [b1517df1] Running /usr/bin/env git ls-remote --heads git#github.com:aceofw
ings/App.git as deploy#192.168.1.84
DEBUG [b1517df1] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/App/git-ssh
.sh /usr/bin/env git ls-remote --heads git#github.com:aceofwings/App.git )
DEBUG [b1517df1] Permission denied (publickey).
DEBUG [b1517df1] fatal: Could not read from remote repository.
DEBUG [b1517df1]
DEBUG [b1517df1] Please make sure you have the correct access rights
DEBUG [b1517df1] and the repository exists.
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy#192.168.1.84:
git exit status: 128
git stdout: Nothing written
git stderr: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
SSHKit::Command::Failed: git exit status: 128
git stdout: Nothing written
The Deploy.rb file
###############Deploy.rb##################
# config valid only for current version of Capistrano
lock '3.4.0'
set :repo_url, 'git#github.com:aceofwings/App.git'
set :application, 'App'
set :user, 'deploy'
#set :pty, true
# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
# Default value for linked_dirs is []
# set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
namespace :deploy do
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
end
Production.rb
server '192.168.1.84', user: 'deploy', roles: %w{app db web}
#set :stage, :production
role :app, %w{deploy#192.168.1.84}
role :web, %w{deploy#192.168.1.84}
role :db, %w{deploy#192.168.1.84}
set :ssh_options, {
forward_agent: false,
auth_methods: %w(password),
password: 'Deploy4Real',
user: 'deploy'
}
I had a similar problem. It turns out that the SSH agent was not running. I found this out looking at the Capistrano documentation: http://capistranorb.com/documentation/getting-started/authentication-and-authorisation/
Running this command:
$ ssh-add -l
showed me that my public key was not added to the agent so I had to add it:
$ ssh-add
Identity added: /Users/me/.ssh/id_rsa (/Users/me/.ssh/id_rsa)
After this my Capistrano deployment worked.
You should set in production.rb:
forward_agent: true
I was having the same problem with Capistrano 3.4. With Capistrano 3.2.1 it seemed to ignore this parameter.
You can use capistrano-ssh-doctor to troubleshoot possible config problems.
I think your capistrano may have some old files in its git cache, probably from renaming the repository or something like that. Try to delete the cached-copy folder in the shared folder on the server, so capistrano will pull your repo again.
I'm using the Capistrano gem and this tutorial to deploy my application to my remote server. Everything works fine until the end of the cap deploy command. I'm receiving this error:
** [ps123456.dreamhostps.com :: out] sh: myapp.git/releases/20130916201449/REVISION: No such file or directory
command finished in 2266ms
*** [deploy:update_code] rolling back
* executing "rm -rf myapp.git/releases/20130916201449; true"
servers: ["ps123456.dreamhostps.com"]
[ps123456.dreamhostps.com] executing command
command finished in 254ms
failed: "sh -c 'git clone --depth 1 ssh://username#ps123456.dreamhostps.com/~/myapp.git myapp.git/releases/20130916201449 && cd myapp.git/releases/20130916201449 && git checkout -b deploy 497af4d996358f8d1f42dc9658e276ee8d9fa64f && git submodule init && git submodule sync && export GIT_RECURSIVE=$([ ! \"`git --version`\" \\< \"git version 1.6.5\" ] && echo --recursive) && git submodule update --init $GIT_RECURSIVE && rm -Rf myapp.git/releases/20130916201449/.git && (echo 497af4d996358f8d1f42dc9658e276ee8d9fa64f > myapp.git/releases/20130916201449/REVISION)'" on ps123456.dreamhostps.com
Here is my deploy.rb:
require 'bundler/capistrano'
set :user, 'username'
set :domain, 'ps123456.dreamhostps.com'
set :applicationdir, "myapp.git"
default_run_options[:pty] = true
set :scm, 'git'
set :repository, "ssh://username#ps123456.dreamhostps.com/~/myapp.git"
set :git_enable_submodules, 1 # if you have vendored rails
set :branch, 'master'
set :git_shallow_clone, 1
set :scm_verbose, true
# roles (servers)
role :web, domain
role :app, domain
role :db, domain, :primary => true
# deploy config
set :deploy_to, applicationdir
set :deploy_via, :export
# additional settings
default_run_options[:pty] = true # Forgo errors when deploying from windows
# Passenger
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
What is going wrong?
It's hard to say exactly, but it's clear that your releases/#{revision} dir is missing by the time you try to push the git revision into the file REVISION.
One likely issue that should probably get fixed is your :deploy_to dir is the same directory on the same machine as the git repo you are cloning from. Try this instead:
In your deploy.rb
set :deploy_to, "/home/#{user}/app/#{application}"
Then make sure to run this the first time:
cap deploy:setup
Then feel free to:
cap deploy
After a lot of head scratching, oddly enough, it was cap deploy:setup that was my downfall. I am still unsure as to what was going on, but I have thoroughly tested and verified that deleting the deployment directory and redeploying the application without running cap deploy:setup will work.
For some reason, running cap deploy:setup, even after successful deploys, will cause permission errors and causes cap deploy to be unable to create and write to directories.
I'm trying to deploy with Capistrano and RVM and even though when running cap bundler:install_bundler which is supposed to install bundler, and succeeds. After, when running cap deploy it fails with an error that bundler is not installed.
** [out :: victorstan.com] ERROR: Gem bundler is not installed, run `gem install bundler` first.
Any ideas why it installs bundler, but then can't find it, or installs it in the wrong place (i guess?). Thanks!
here is part of my deploy.rb script:
set :application, "dinner"
set :domain, "victorstan.com"
set :repository, "ssh://#{domain}/~/#{application}.git"
set :use_sudo, false
set :user, "victorstan" # The server's user for deploys
set :scm, :git
set :scm_username, "passenger"
set :deploy_to, "/srv/www/#{application}"
set :keep_releases, 2
set :branch, "master"
set :deploy_via, :copy # won't make cap prompt for password when deploying
set :scm_verbose, true
set :rvm_ruby_string, 'ruby-2.0.0-p195#dinner'
set :rvm_type, :user
set :rvm_install_type, :stable
set :whenever_command, "bundle exec whenever"
require "bundler/capistrano"
require "rvm/capistrano"
require "whenever/capistrano"
If I try to use cap to install bundler, it works:
cap bundler:install_bundler
* 2013-06-08 15:33:54 executing `bundler:install_bundler'
* executing "gem install bundler"
servers: ["victorstan.com"]
[victorstan.com] executing command
** [out :: victorstan.com] Successfully installed bundler-1.3.5
** [out :: victorstan.com] 1 gem installed
command finished in 1373ms
And here is the output when running cap deploy:
Switched to a new branch 'deploy'
command finished in 984ms
* Compressing /var/folders/w4/_6g_9lqd491_6cmhzb0kcmzh0000gn/T/20130608192600 to /var/folders/w4/_6g_9lqd491_6cmhzb0kcmzh0000gn/T/20130608192600.tar.gz
executing locally: tar czf 20130608192600.tar.gz 20130608192600
command finished in 53ms
servers: ["victorstan.com"]
** sftp upload /var/folders/w4/_6g_9lqd491_6cmhzb0kcmzh0000gn/T/20130608192600.tar.gz -> /tmp/20130608192600.tar.gz
[victorstan.com] /tmp/20130608192600.tar.gz
[victorstan.com] done
* sftp upload complete
* executing "cd /srv/www/dinner/releases && tar xzf /tmp/20130608192600.tar.gz && rm /tmp/20130608192600.tar.gz"
servers: ["victorstan.com"]
[victorstan.com] executing command
command finished in 467ms
* 2013-06-08 15:26:05 executing `deploy:finalize_update'
triggering before callbacks for `deploy:finalize_update'
* 2013-06-08 15:26:05 executing `bundle:install'
* executing "cd /srv/www/dinner/releases/20130608192600 && bundle install --gemfile /srv/www/dinner/releases/20130608192600/Gemfile --path /srv/www/dinner/shared/bundle --deployment --quiet --without development test"
servers: ["victorstan.com"]
[victorstan.com] executing command
** [out :: victorstan.com] ERROR: Gem bundler is not installed, run `gem install bundler` first.
command finished in 598ms
*** [deploy:update_code] rolling back
* executing "rm -rf /srv/www/dinner/releases/20130608192600; true"
servers: ["victorstan.com"]
[victorstan.com] executing command
command finished in 513ms
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell 'ruby-2.0.0-p195#dinner' -c 'cd /srv/www/dinner/releases/20130608192600 && bundle install --gemfile /srv/www/dinner/releases/20130608192600/Gemfile --path /srv/www/dinner/shared/bundle --deployment --quiet --without development test'" on victorstan.com
is ruby-2.0.0-p195#dinner installed / created on the server?
you can ensure it is with adding:
before 'deploy:setup', 'rvm:install_ruby'
more details on using rvm-capistrano can be found here: https://github.com/wayneeseguin/rvm-capistrano#readme
I have read some more examples on setting up deploy script and i've re-arranged the order of elements of my deploy script, as well as ena
set :application, "dinner"
set :domain, "victorstan.com"
set :repository, "ssh://#{domain}/~/#{application}.git"
set :use_sudo, false
set :user, "victorstan" # The server's user for deploys
set :scm, :git
set :scm_username, "passenger"
set :scm_passphrase, "*********" # The deploy user's password
set :deploy_to, "/srv/www/#{application}"
set :keep_releases, 2
set :branch, "master"
set :deploy_via, :copy # won't make cap prompt for password when deploying
set :scm_verbose, true
set :rvm_ruby_string, :local
set :rvm_type, :user
set :rvm_install_type, :stable
set :default_shell, :bash
set :whenever_command, "bundle exec whenever"
default_run_options[:pty] = true
# before 'deploy', 'rvm:install_ruby'
before 'deploy:setup', 'rvm:install_ruby'
require "rvm/capistrano"
require "bundler/capistrano"
require "whenever/capistrano"
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
Some notable elements that have changed:
set :rvm_ruby_string set to :local instead of explicitly naming it: 'ruby-2.0.0-p195#dinner', not sure if this has any implication on the issue though, seems unlikely.
set :default_shell, :bash was another parameter I added.
And, as I mentioned, the ordering or the different DSL types might make a difference: set comes first, then before hooks, then require and then role after which comes the rest of the deploy script. Perhaps this can help someone in a similar situation.
Note, when I first tested this script I had before 'deploy', 'rvm:install_ruby' enabled, but I have since disabled it and the script continues to work...
Good day! I'll try to be very specific with this. I'm sorry, but I've had experience a lot of troubles while trying to deploy my application. I'm totally new at rails, so I followed the Agile Web Development with Rails 4th Edition and I'm trapped on the segment of deploy with capistrano I've tried the exact code on the book, didn't work, and take some advices from this and others forums that prove to be helpful, but I'm still can't deploy correctly my deploy.rb goes like this:
require 'bundler/capistrano'
set :user, 'user_created_for_this_example'
set :domain, 'IPADDRESS'
set :application, 'depot'
# file paths
set :repository, "#{user}##{domain}:depot.git"
set :deploy_to, "/home/#{user}/#{domain}"
# set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess
based on known version control directory names
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
#roles server
role :web, domain
role :app, domain
role :db, domain, :primary => true
#deploy config
set :deploy_to, "/home/#{user}/#{domain}"
set :deploy_via, :copy
set :scm, 'git'
set :branch, 'master'
set :scm_verbose, true
set :use_sudo, false
# if you want to clean up old releases on each deploy uncomment this:
# after "deploy:restart", "deploy:cleanup"
# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts
# 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
after "deploy:update_code", :bundle_install
desc "install the necesary prerequisites"
task :bundle_install, :roles => :app do
run "cd #{release_path} && bundle install"
end
When i run the cap deploy:setup and cap deploy:check all seems to be working fine:
~/rails_projects/depot$ cap deploy:setup
* 2012-11-13 10:37:35 executing `deploy:setup'
* executing "mkdir -p /home/git/xx.xx.xx.xx /home/git/xx.xx.xx.xx/releases /home/git
/xx.xx.xx.xx/shared /home/git/xx.xx.xx.xx/shared/system /home/git/xx.xx.xx.xx/shared/log
/home/git/xx.xx.xx.xx/shared/pids"
servers: ["xx.xx.xx.xx"]
[xx.xx.xx.xx] executing command
command finished in 158ms
* executing "chmod g+w /home/git/xx.xx.xx.xx /home/git/xx.xx.xx.xx/releases /home/git/xx.xx.xx.xx/shared /home/git/xx.xx.xx.xx/shared/system /home/git/xx.xx.xx.xx/shared/log /home/git/xx.xx.xx.xx/shared/pids"
servers: ["xx.xx.xx.xx"]
[xx.xx.xx.xx] executing command
command finished in 7ms
~/rails_projects/depot$ cap deploy:check
* 2012-11-13 10:37:39 executing `deploy:check'
* executing "test -d /home/git/xx.xx.xx.xx/releases"
servers: ["xx.xx.xx.xx"]
[xx.xx.xx.xx] executing command
command finished in 152ms
* executing "test -w /home/git/xx.xx.xx.xx"
servers: ["xx.xx.xx.xx"]
[xx.xx.xx.xx] executing command
command finished in 5ms
* executing "test -w /home/git/xx.xx.xx.xx/releases"
servers: ["xx.xx.xx.xx"]
[xx.xx.xx.xx] executing command
command finished in 5ms
* executing "which tar"
servers: ["xx.xx.xx.xx"]
[xx.xx.xx.xx] executing command
command finished in 6ms
You appear to have all necessary dependencies installed
But when the cap deploy:migrations, cap deploy or cap deploy:cold command comes the next pops up:
~/rails_projects/depot$ cap deploy:migrations
* 2012-11-13 10:37:42 executing `deploy:migrations'
* 2012-11-13 10:37:42 executing `deploy:update_code'
executing locally: "git ls-remote git#xx.xx.xx.xx:depot.git master"
command finished in 241ms
* getting (via checkout) revision c3f88ca97e5868dd476f20e9a044b7dad800274a to /tmp/20121113173743
executing locally: git clone git#xx.xx.xx.xx:depot.git /tmp/20121113173743 && cd /tmp/20121113173743 && git checkout -b deploy c3f8
8ca97e5868dd476f20e9a044b7dad800274a
Cloning into '/tmp/20121113173743'...
remote: Counting objects: 392, done.
remote: Compressing objects: 100% (257/257), done.
remote: Total 392 (delta 111), reused 392 (delta 111)
Receiving objects: 100% (392/392), 8.59 MiB, done.
Resolving deltas: 100% (111/111), done.
Switched to a new branch 'deploy'
command finished in 769ms
* Compressing /tmp/20121113173743 to /tmp/20121113173743.tar.gz
executing locally: tar czf 20121113173743.tar.gz 20121113173743
command finished in 652ms
servers: ["xx.xx.xx.xx"]
** sftp upload /tmp/20121113173743.tar.gz -> /tmp/20121113173743.tar.gz
[xx.xx.xx.xx] /tmp/20121113173743.tar.gz
*** upload via sftp failed on xx.xx.xx.xx: Net::SFTP::StatusException
(Net::SFTP::StatusException open /tmp/20121113173743.tar.gz (3, "permission denied"))
upload via sftp failed on xx.xx.xx.xx: Net::SFTP::StatusException (Net::SFTP::StatusException open /tmp/20121113173743.tar.gz (3, "permission denied"))
I'm sorry if this is some dummy issue, an easy-fix or an already posted one, but I don't know what else to try, again I'm just starting with this stuff and I'm truly lost. I'm running all from the same machine and all the xx.xx.xx.xx stands for my ip address. Any suggestions will be really appreciated. I've tried to be specific as possible, but if something is missing I'll post it. Thanks beforehand for your time and help.
Your problem here is that your source and destination locations for sftp are the same:
** sftp upload /tmp/20121113173743.tar.gz -> /tmp/20121113173743.tar.gz
in order to fix the issue you may specify parameter copy_dir in your config/deploy.rb file, something like this:
set :copy_dir, "/tmp/sftp"
no need to create that folder manually then.
Try adding this line to your deploy.rb configuration file:
default_run_options[:pty] = true
We changed the Capfile from
set :deploy_via, :copy
to
set :deploy_via, :remote_cache
and this worked for us. We did not add the below line
default_run_options[:pty] = true
I am trying to deploy my rails application for the first time.
Server is running Ubuntu 10.4 server (64bit)
Local machine is running Windows XP.
Repository is at github
I have successfully run
cap deploy:setup
but when I run
cap deploy:cold
I get the following error:
D:\Rails\rails_apps\fx>cap deploy:cold
You are running Ruby 1.8.6, which has a bug in its threading implementation.
You are liable to encounter deadlocks running Capistrano, unless you install
the fastthread library, which is available as a gem:
gem install fastthread
* executing `deploy:cold'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/fx/releases/20100818215651; true"
servers: ["pragmaticriskmanagement.gotdns.com"]
[pragmaticriskmanagement.gotdns.com] executing command
command finished
D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy.rb:37:in ``': No such file or directory - git rev-parse master (Errno::ENOENT)
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy.rb:37:in `load'
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy.rb:87:in `with_env'
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy.rb:37:in `load'
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistran/recipes/deploy/scm/git.rb:154:in `query_revision'
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `send'
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `method_missing'
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/base.rb:63:in `local'
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `method_missing'
... 39 levels...
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/lib/capistrano/cli/execute.rb:14:in `execute'
from D:/Rails/ruby/lib/ruby/gems/1.8/gems/capistrano-2.1.0/bin/cap:4
from D:/Rails/ruby/bin/cap:19:in `load'
from D:/Rails/ruby/bin/cap:19
Here is my 'deploy.rb' file
set :application, "fx" #"pragmaticriskmanagement.gotdns.com"
set :repository, "git#github.com:jmedding/Fx.git"
set :deploy_to, "/var/www/#{application}"
set :git_enable_submodules, 1 # Make sure git submodules are populated
set :location, "pragmaticriskmanagement.gotdns.com"
set :user, "xxxxx"
set :use_sudo, false
set :scm, :git
role :app, location #"your app-server here"
role :web, location #"your web-server here"
role :db, location, :primary => true #"your db-server here", :primary => true
namespace :deploy do
desc "Restart Application"
task :restart, :roles => :app do
run "touch #{current_path}/tmp/restart.txt"
end
desc "Make symlink for database.yml"
task :symlink_dbyaml do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end
desc "Create empty database.yml in shared path"
task :create_dbyaml do
run "mkdir -p #{shared_path}/config"
put '', "#{shared_path}/config/database.yml"
end
end
after 'deploy:setup', 'deploy:create_dbyaml'
after 'deploy:update_code', 'deploy:symlink_dbyaml'
after "deploy", "deploy:cleanup"
and now I'm stuck...
Any help would be greatly appreciated.
Thanks,
Jon
Sorry to resurrect such an old thread, but I solved this by adding the default location of my git binaries (C:\Program Files (x86)\Git\bin) to my PATH variable.
Ok, I have made some progress.
It seems that the error indicates that the git ls-remote command could not be found on the local system (win xp). As a test, I opened the GIT Bash shell and tried the command - it worked. Next, I tried
cap deploy
from the GIT Bash shell. Command not found. OK, I added my rails path
D:\Rails\ruby\bin
to the windows 'path' variable. Now, try
cap deploy
from the bash shell. This seems to have solved this problem, which now leads to my next problem
** [xxxxxxxx.com :: out] Cloning into /var/www/fx/shared/cached-copy...
** [xxxxxxxx.com :: err] Permission denied (publickey).
** [xxxxxxxx.com :: err] fatal: The remote end hung up unexpectedly
I can successfully run cap deploy from my linux box with the same public key. Also, I can push to my Github repo from this laptop with this key. Of course, the key in question should be on the server, but if it works when I run 'cap' from the linux box, why wouldn't it run from here?