1

I'm deploying a Rails app with Mina mina:deploy which clones from a git repo and Bundler installs the gems.

# /config/deploy.rb
# ...
task :deploy => :environment do
  deploy do
    invoke :'git:clone'
    invoke :'bundle:install'
    # ...
  end
end

However, unlike when I bundle install manually, mina is installing each gem anew. With a healthy number of gems, this takes roughly 10 minutes to complete. How can I deploy while pointing bundler to use any locally available (already installed) gems where possible?

I've also tried replacing invoke :'bundle:install' with queue! "bundle install --local" with no change in behavior.

Sam
  • 1,205
  • 1
  • 21
  • 39

1 Answers1

0

For that you need to use a local copy of the gems that you have without checking rubygems so after installing gems you run bundle package to create a cache of the gems used and instead of running bundle install you should run bundle install --local to use only the cached copy of gems without checking the rubygems.com .

Kiloreux
  • 2,220
  • 1
  • 17
  • 24
  • Cheers for this. Have you had success specifically with Mina? If so, can you post how you incorporate this into your deployment? – Sam Aug 24 '15 at 16:44