diff --git a/app/models/deploy_local.rb b/app/models/deploy_local.rb index b5a15cfe..4f8744f3 100644 --- a/app/models/deploy_local.rb +++ b/app/models/deploy_local.rb @@ -16,7 +16,7 @@ class DeployLocal < Deploy # XXX: Desde que ya no compartimos el directorio de gemas, tenemos # que hacer limpieza después de instalar. - run %(bundle install --deployment --no-cache --path="#{site.bundle_path}" --clean --without test development), output: output + run %(bundle install #{'--deployment' if site.gemfile_lock_path?} --no-cache --path="#{site.bundle_path}" --clean --without test development), output: output end # Realizamos la construcción del sitio usando Jekyll y un entorno diff --git a/app/models/site.rb b/app/models/site.rb index a67b3b5b..b0edc08b 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -458,6 +458,10 @@ class Site < ApplicationRecord @bundle_path ||= Rails.root.join('_storage', 'gems', name) end + def gemfile_lock_path? + File.exist? gemfile_lock_path + end + private # Asegurarse que el sitio tenga una llave privada @@ -594,7 +598,7 @@ class Site < ApplicationRecord # Detecta si el Gemfile.lock fue modificado def gemfile_lock_updated? - return false unless File.exist? gemfile_lock_path + return false unless gemfile_lock_path? updated_at < File.mtime(gemfile_lock_path) end