Take the 2-minute tour ×

When trying to execute the command cap deploy from a Windows machine, I'm getting this error coming back from the VPS:

sh: rake: not found

If I SSH into the server itself, I can easily run rake without issues. It's in a weird location because I'm using RVM, but it still works. It seems like somehow the knowledge of its location is getting messed up when it's being run from Capistrano.

Agile Web Development with Rails adds the following to deploy.rb:

require "rvm/capistrano"
set :rvm_ruby_string, '1.9.2'
set :rvm_type, :user

The problem is, I'm on a Windows machine (not using RVM), and that causes the whole deploy Capistrano task to crash because I don't have RVM. Do I need to have RVM installed locally for this to work? I would expect it's only necessary on the server.

Why the heck can't rake be found?! Sure works when I SSH into the server myself...

EDIT: It looks like this question is very similar:

Capistrano fails to deploy to remote server

However, his solution appears to involve doing the same thing I was trying to do -- except somehow he has no problem with the line require "rvm/capistrano", which crashes on my machine. Also, his paths don't appear to be in the same format as mine?

Mine: /home/sysadmin/.rvm/gems/ruby-1.9.3-p194@global/bin/rake

His: /usr/local/rvm/gems/ruby-1.9.2-p290@rails31dataserver/bin

I'm really confused about how these environments work...

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Duh, I didn't have the Capistrano RVM gem installed, so I couldn't require "rvm/capistrano" correctly. gem install rvm-capistrano fixed this issue.

share|improve this answer
add comment

Your Answer


