Method: Jets::Builders::CodeBuilder#bundle_install

Defined in:
lib/jets/builders/code_builder.rb

#bundle_installObject

Installs gems on the current target system: both compiled and non-compiled. If user is on a macosx machine, macosx gems will be installed. If user is on a linux machine, linux gems will be installed.

Copies Gemfile* to /tmp/jetss/demo/bundled folder and installs gems with bundle install from there.

We take the time to copy Gemfile and bundle into a separate directory because it gets left around to act as a ‘cache’. So, when the builds the project gets built again not all the gems from get installed from the beginning.



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/jets/builders/code_builder.rb', line 323

def bundle_install
  return if poly_only?

  headline "Bundling: running bundle install in cache area: #{cache_area}."

  copy_gemfiles

  require "bundler" # dynamically require bundler so user can use any bundler
  Bundler.with_clean_env do
    # cd /tmp/jets/demo
    sh(
      "cd #{cache_area} && " \
      "env BUNDLE_IGNORE_CONFIG=1 bundle install --path bundled/gems --without development test"
    )
  end

  puts 'Bundle install success.'
end