diff --git a/app/models/site.rb b/app/models/site.rb index fab16b58..9bc2c7f4 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -561,15 +561,25 @@ class Site < ApplicationRecord deploy_local = deploys.find_by_type('DeployLocal') deploy_local.git_lfs - if !gem_dir? || gemfile_updated? || gemfile_lock_updated? + if !gems_installed? || gemfile_updated? || gemfile_lock_updated? deploy_local.bundle touch end end + def gem_path + @gem_path ||= + begin + ruby_version = Gem::Version.new(RUBY_VERSION) + ruby_version.canonical_segments[2] = 0 + + bundle_path.join('ruby', ruby_version.canonical_segments.join('.')) + end + end + # Detecta si el repositorio de gemas existe - def gem_dir? - Rails.root.join('_storage', 'gems', name).directory? + def gems_installed? + gem_path.directory? && !gem_path.empty? end # Detecta si el Gemfile fue modificado