title: Capistrano Could not locate Gemfile or .bundle/ directory?
body: <p>I try to use <strong>Capistrano</strong> in my rails app on <strong>Ubuntu server</strong>, and run cap production deploy got this message:</p>
  
  <pre><code>Could not locate Gemfile or .bundle/ directory
  </code></pre>
  
  <p>here is my setting:</p>
  
  <pre><code>lock '3.4.0'
  
  `ssh-add` # need this to make key-forwarding work
  
  set :application, 'beaconserver'
  set :repo_url, 'my git'
  
  set :deploy_to, '/home/john/projects/beaconserver'
  set :log_level, :debug
  set :keep_releases, 5
  set :linked_files, %w(config/database.yml config/secrets.yml)
  set :linked_dirs, fetch(:linked_dirs, []).push("bin", "log", "tmp/pids", "tmp/cache", "tmp/sockets", "vendor/bundle", "public/system") 
  
  
  # rbenv 的設定
  set :rbenv_type, :user 
  set :rbenv_ruby, "2.2.2"
  set :rbenv_path, "/usr/local/rbenv"
  set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
  set :rbenv_map_bins, %w(rake gem bundle ruby rails)
  set :rbenv_roles, :all 
  
  namespace :deploy do
    after :restart, :clear_cache do
      on roles(:web), in: :groups, limit: 3, wait: 10 do
          execute :rake, 'cache:clear'
      end
    end
  end
  </code></pre>
  
  <p>and I found a problem, in my setting: </p>
  
  <pre><code>set :rbenv_path, "/usr/local/rbenv"
  set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
  </code></pre>
  
  <p>but my server doesn't exist <strong>/usr/local/rbenv/bin/rbenv</strong></p>
  
  <p>and there is <strong>/usr/local/rbenv/bin</strong>, I enter <strong>ls -al</strong> and shows:</p>
  
  <pre><code>drwxr-xr-x  2 root root 4096 Aug  6 08:50 .
  drwxrwxrwx 11 root root 4096 Aug  6 09:03 ..
  lrwxrwxrwx  1 root root   16 Aug  6 08:50 rbenv -&gt; ../libexec/rbenv
  -rwxr-xr-x  1 root root  724 Aug  6 08:50 ruby-local-exec
  </code></pre>
  
  <p>what does this mean? did it means that I change the <strong>/usr/local/rbenv/bin/rbenv</strong> position to some where like <strong>../libexec/rbenv</strong>?? maybe I do something wrong when I install rbenv, how can I fix it? </p>
  
  <p>my gemfile:</p>
  
  <pre><code>  gem "capistrano", '3.4.0'
    gem "capistrano-rvm", '0.1.2'
    gem "capistrano-rbenv", '2.0.3', require: false # production server use rbenv
    gem "capistrano-rails", '1.1.3'
    gem 'capistrano-passenger', '0.1.1'
    gem 'capistrano-bundler','1.1.4'
  </code></pre>
  
  <p>capfile:</p>
  
  <pre><code> require 'capistrano/rails'
   require 'capistrano/rbenv'
   require 'capistrano/bundler' 
   require 'capistrano/rails/assets'assets:precompile
   require 'capistrano/rails/migrations'
   require 'capistrano/passenger'
  </code></pre>