Capistrano issues – no such file or directory

So I was playing around with my new Slicehost the other day and following their guides to automate a Ruby on Rails deployment process using capistrano.

For those that don’t know, capistrano comes as a ruby gem which allows you to completely automate tasks. In my case, I wanted to remotely tell my Ruby on Rails application to retrieve the latest version of the application from github (remote repository) and then restart my Rails app.

The documentation tells me that a simply “cap deploy” from the root of my rails folder should execute my capistrano script. However for hours upon hours I was banging my head against a wall.

Here’s the error I was receiving;

C:\Web\> cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote master"
*** [deploy:update_code] rolling back
* executing "rm -rf /home/xxxx/public_html/releases/20100222103818; true"
servers: [""]
[] executing command
command finished
C:/Apps/Ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.16/lib/capistrano/recipes/deploy.rb:98:in ``': No such file or direct
ory - git ls-remote master (Errno::ENOENT)

The solution

Ok so I’m not really going to call this a solution because I don’t know why this works (and maybe one of you can assist me in this) but running the command “cap deploy” under a MINGW32 command shell instead of the usual Windows command prompt seemed to work just fine.

(I just MINGW32 as a shell to run all my GIT repository commands)

If you don’t use Git on windows or you don’t have MINGW32 installed, I suggest you have a look at this Git on Windows page.

Leave a Reply

You must be logged in to post a comment.