7

Every time I deploy an app with Capistrano, it complains about missing gems. For example:

 ** [out :: mysite.com] Could not find WhateverGem-1.0.0 in any of the sources
 ** [out :: mysite.com] Run `bundle install` to install missing gems.

I resolve this by manually uploading my Gemfile, SSHing into the server, and running bundle install. However, this should not be happening.

Here's a copy of my deploy.rb and Capfile.

Could anybody point me in the right direction?

Yuval Karmi
  • 26,277
  • 39
  • 124
  • 175

1 Answers1

19

You probably just need to add this to your config/deploy.rb

require "bundler/capistrano"
Jesse Wolgamott
  • 40,197
  • 4
  • 83
  • 109
  • Thanks! That solves the problem with bundling, but I still get the following error when trying to migrate the database: `Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (mysql2 is not part of the bundle. Add it to Gemfile.)` It's already included in my Gemfile (and I'm using the mysql2 adapter in the `database.yml` file) but I don't see it when I look inside the shared/bundle folder. Any ideas what's going on? Thanks! – Yuval Karmi Jun 03 '12 at 23:18
  • turns out this was a weird version control issue. The Gemfile that was being pushed to the server didn't contain the `mysql2` Gem... Not sure why. – Yuval Karmi Jun 04 '12 at 23:05
  • Sometimes you do more silly things than you expect from yourself. In my case, I never pushed the code and gems were never getting installed. Just in case it helps. Great answer anyways. – Nerve May 01 '16 at 09:11