Skip to content

Commit 141c62e

Browse files
justin808claude
andcommitted
Only use BUNDLE_GEMFILE isolation for minimum version examples
The BUNDLE_GEMFILE env var was causing issues for latest version examples because bundler was detecting Gemfile/lockfile mismatches in frozen mode. Changes: - Only set BUNDLE_GEMFILE and BUNDLE_FROZEN=false for minimum version examples - Latest examples continue using standard bundle exec This ensures: - Latest examples work normally without bundler isolation issues - Minimum examples are properly isolated from parent workspace gems 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent ef3377f commit 141c62e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

react_on_rails/rakelib/shakapacker_examples.rake

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,17 @@ namespace :shakapacker_examples do # rubocop:disable Metrics/BlockLength
114114
sh_in_dir(example_type.dir, "npm install")
115115
# Generate the component packs after running the generator to ensure all
116116
# auto-bundled components have corresponding pack files created.
117-
# Use BUNDLE_GEMFILE to ensure bundler uses the generated app's Gemfile
118-
# and not any parent workspace's bundle, which could have different gem versions.
119-
gemfile_path = File.join(example_type.dir, "Gemfile")
120-
sh_in_dir(example_type.dir, "BUNDLE_GEMFILE=#{gemfile_path} bundle exec rake react_on_rails:generate_packs")
117+
if example_type.minimum_versions
118+
# For minimum version examples, use BUNDLE_GEMFILE to ensure bundler uses
119+
# the generated app's Gemfile and not any parent workspace's bundle,
120+
# which could have different gem versions. Also use BUNDLE_FROZEN=false
121+
# to allow the lockfile to be updated.
122+
gemfile_path = File.join(example_type.dir, "Gemfile")
123+
sh_in_dir(example_type.dir,
124+
"BUNDLE_GEMFILE=#{gemfile_path} BUNDLE_FROZEN=false bundle exec rake react_on_rails:generate_packs")
125+
else
126+
sh_in_dir(example_type.dir, "bundle exec rake react_on_rails:generate_packs")
127+
end
121128
end
122129
end
123130

0 commit comments

Comments
 (0)