title: Debugging Capistrano
body: <p>I'm deploying to a VPS using capistrano, based on the guide at RailsCasts. 
  <a href="http://railscasts.com/episodes/335-deploying-to-a-vps?view=asciicast" rel="noreferrer">http://railscasts.com/episodes/335-deploying-to-a-vps?view=asciicast</a></p>
  
  <p>It's failing on the <strong>deploy:cold</strong> command, with a conflict with Ruby. I actually can't see what the problem is, as when I shell into the same user the Ruby version looks correct.</p>
  
  <pre><code>$ cap shell
  cap&gt; which ruby
  [establishing connection(s) to 192.xxx.xxx.xxx]
   ** [out :: 192.xxx.xxx.xxx] /home/deployer/.rbenv/shims/ruby
  cap&gt; ruby -v
  ** [out :: 192.xxx.xxx.xxx ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
  </code></pre>
  
  <p>This is the error:</p>
  
  <pre><code>command finished in 655ms
  * 2013-07-01 16:40:39 executing `bundle:install'
  * executing "cd /home/deployer/rails/assay/releases/20130701144038 &amp;&amp; bundle install --  gemfile /home/deployer/rails/assay/releases/20130701144038/Gemfile --path   /home/deployer/rails/assay/shared/bundle --deployment --quiet --without development test"
  servers: ["192.xxx.xxx.xxx"]
  [192.xxx.xxx.xxx] executing command
  ** [out :: 192.xxx.xxx.xxx] rbenv: version `1.9.3' is not installed
  command finished in 662ms
  *** [deploy:update_code] rolling back
  </code></pre>
  
  <p>My question is: <strong>how can I debug this?</strong> When I read the <strong>deploy.rb</strong> file I can't see where it even references the Ruby version. Pretty frustrating, I am about ready to ftp the repo up, which is not ideal obviously.</p>