19

I use EngineYard, and I have a deployment that is failing. I am getting this message:

Some gems seem to be missing from your vendor/cache directory.
Could not find rspec-core-2.6.0.rc2 in any of the sources

How do I make sure those gems get in that directory?

RubyRedGrapefruit
  • 12,066
  • 16
  • 92
  • 193

5 Answers5

38

Bundler ships a command which explicitly creates this cache

bundle package

After you've done this bundle install will check and keep the vendor/cache directory up to date.

If you then want to install the gems on a machine without checking on rubygems, you just run

bundle install --local

However, beware, if you are upgrading gems frequently (like I do every time a subrelease of Rails comes out), your vendor/cache can quickly grow.

My current project's git repository is 80mb, of which more than 30mb is data stored in vendor/cache.

It seemed like a good idea to speed up deploys, but overall its just made our repository much bigger.

Matthew Rudy
  • 16,724
  • 3
  • 46
  • 44
6

In case anyone else is experiencing this when deploying with Capistrano, this solved it for me: https://github.com/carlhuda/bundler/issues/1454

Having an empty vendor/cache directory was causing the problem in my case.

Solution was to delete (not just ignore the contents of!) the vendor/cache directory from version control and commit + deploy.

dleavitt
  • 1,386
  • 13
  • 14
1

Its bundle cache now for anyone wondering

   bundle cache(1) bundle-cache.1.html
         Package the .gem files required by your application into the vendor/cache directory (aliases: bundle package, bundle pack)
Mr. Rene
  • 1,167
  • 10
  • 17
-1

bundle package without installing the downloading gems.

bundle package --no-install
vidur punj
  • 5,019
  • 4
  • 46
  • 65
-4

I figured this out. I just typed:

bundle

at the command line, and it added the missing gems.

RubyRedGrapefruit
  • 12,066
  • 16
  • 92
  • 193
  • Just `bundle` is equivalent to `bundle install`, which does not, in itself put gems in vendor/cache. You need to use `bundle package` – wndxlori Dec 15 '17 at 18:03