title: How to get Capistrano 3 to use RVM ruby?
body: <p>Gemfile:</p>
  
  <pre><code>gem 'capistrano', '~&gt; 3.0.0'
  gem 'capistrano-rails'
  gem 'capistrano-bundler'
  gem 'capistrano-rvm'
  gem 'capistrano3-puma'
  </code></pre>
  
  <p>Deploy.rb:</p>
  
  <pre><code>set :rvm_type, :user
  set :rvm_ruby_version, '2.1.1'
  set :default_env, { rvm_bin_path: '~/.rvm/bin' }
  </code></pre>
  
  <p>Production.rb</p>
  
  <pre><code>namespace :rails do
    desc "Open the rails console on primary app server"
    task :console do
      on roles(:app), primary: true do
        execute_interactively "#{current_path}/script/rails console RAILS_ENV=production"
      end
    end
  
    def execute_interactively(command)
      cmd = "ssh -l deploy 255.255.255.255 -p 21 -t 'cd #{deploy_to}/current &amp;&amp; #{command}'"
      info "Connecting to 255.255.255.255"
      exec cmd
    end
  end
  </code></pre>
  
  <p>Capfile:</p>
  
  <pre><code>require 'capistrano/setup'
  require 'capistrano/deploy'
  require 'capistrano/rvm'
  require 'capistrano/bundler'
  require 'capistrano/rails/assets'
  require 'capistrano/rails/migrations'
  require 'capistrano/puma'
  require 'whenever/capistrano'
  Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
  </code></pre>
  
  <p>When I run <code>cap production rvm:check</code> the output is:</p>
  
  <pre><code>rvm 1.25.19 (master) by Wayne E. Seguin &lt;wayneeseguin@gmail.com&gt;, Michal Papis &lt;mpapis@gmail.com&gt; [https://rvm.io/]
  system
  ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]
  </code></pre>
  
  <p>Should it not be using <code>user</code> instead of <code>system</code> because I've specified the <code>rvm_type</code>?</p>
  
  <p>When I run <code>cap production rails:console</code> then I get:</p>
  
  <pre><code>INFO Connecting to 255.255.255.255
  /usr/bin/env: ruby: No such file or directory
  Connection to 255.255.255.255 closed.
  </code></pre>