I’m using Capistrano to deploy a Rails application on a staging environment. cap deploy:update works fine, but Passenger keeps reporting this
Could not find mysql2-0.3.11 in any of the sources (Bundler::GemNotFound)
I did perform bundle install, bundle list and gem list both show the gem as installed and operations that require db access under rails console work fine, all of these on the server. On my machine everything is OK.
I’m using RVM, Ruby 1.9.3, Rails 3.2.8 and this is the relevant part of deploy.rb:
set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"") # Read from local system
require "rvm/capistrano" # Load RVM's capistrano plugin.
Is it a Passenger issue, am I doing something wrong with Capistrano, or is it a problem with gem versions?
Well, after I tried everything, I found out that the answer is as simple as:
bundle install --deployment(on the server)This installed all necessary gems in the
vendorfolder of my app and everything works fine nowEdit:
Or better, in deploy.rb:
require "bundler/capistrano"