title: Whenever give ``require': cannot load such file -- bundler/setup` error in production server
body: <p>Im trying to setup whenever gem in my Ubuntu 14.04 server. In my local machine it works fine. I use capistrano to deploy the site. I use rbenv in the server. But when installing passenger it installs Ruby 1.9 which I do not use. Only use rbenv. Here's my shcedule.rb :</p>
  
  <pre><code>set :output, "#{path}/log/cron.log"
  
  every 30.minutes do
      runner 'UploadmailWorker.perform_async'
  end
  
  every 12.hours do
      runner 'SubscriptionWorker.perform_async'
  end
  
  every :month do
      runner 'PaysellerWorker.perform_async'
  end
  </code></pre>
  
  <p>My deploy.rb :</p>
  
  <pre><code>set :default_environment, {
    'PATH' =&gt; "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
  }
  
  set :whenever_roles,        -&gt;{ :app }
  set :whenever_command,      -&gt;{ [:bundle, :exec, :whenever] }
  set :whenever_command_environment_variables, -&gt;{ {} }
  set :whenever_identifier,   -&gt;{ fetch :application }
  set :whenever_environment,  -&gt;{ fetch :rails_env, fetch(:stage, "production") }
  set :whenever_variables,    -&gt;{ "environment=#{fetch :whenever_environment}" }
  set :whenever_update_flags, -&gt;{ "--update-crontab #{fetch :whenever_identifier} --set #{fetch :whenever_variables}" }
  set :whenever_clear_flags,  -&gt;{ "--clear-crontab #{fetch :whenever_identifier}" }
  
  namespace :deploy do
  
      desc 'Restart application'
      task :restart do
          on roles(:app), in: :sequence, wait: 5 do
              execute :touch, release_path.join('tmp/restart.txt')
          end
      end
  
      after :publishing, 'deploy:restart'
      after :finishing, 'deploy:cleanup'
  end
  </code></pre>
  
  <p>After deploying, the whenever does not work. In the cron.log I find this error :</p>
  
  <pre><code>/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- bundler/setup (LoadError)
          from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
          from /home/deploy/istockseller/releases/20150519112817/config/boot.rb:3:in `&lt;top (required)&gt;'
          from bin/rails:7:in `require_relative'
          from bin/rails:7:in `&lt;main&gt;'
  </code></pre>
  
  <p>How can I fix that?</p>