Skip to content

Commit a279252

Browse files
justin808claude
andcommitted
Add nokogiri version constraint for Ruby 3.0+ in main Gemfile
Added conditional nokogiri ~> 1.17.0 constraint in Gemfile for Ruby 3.0+. Regenerated Gemfile.lock with nokogiri 1.17.2 for Ruby 3.0-3.3 support. This ensures: - Ruby 2.7 uses gemfiles/ruby27.gemfile with nokogiri 1.15.7 - Ruby 3.0+ uses main Gemfile with nokogiri 1.17.2 Also fixed cache key logic in CI workflow to properly separate cache by Ruby version and gemfile. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent dd31062 commit a279252

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.github/workflows/ruby.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,18 @@ jobs:
4444
- name: Set Gemfile for Ruby 2.7
4545
if: matrix.ruby == '2.7'
4646
run: echo "BUNDLE_GEMFILE=${{ github.workspace }}/gemfiles/ruby27.gemfile" >> $GITHUB_ENV
47-
- name: Save dummy app ruby gems to cache
47+
- name: Save dummy app ruby gems to cache (Ruby 2.7)
48+
if: matrix.ruby == '2.7'
49+
uses: actions/cache@v3
50+
with:
51+
path: vendor/bundle
52+
key: root-gem-cache-${{ matrix.ruby }}-${{ hashFiles('gemfiles/ruby27.gemfile.lock') }}
53+
- name: Save dummy app ruby gems to cache (Ruby 3.0+)
54+
if: matrix.ruby != '2.7'
4855
uses: actions/cache@v3
4956
with:
5057
path: vendor/bundle
51-
key: root-gem-cache-${{ matrix.ruby }}-${{ hashFiles(env.BUNDLE_GEMFILE || 'Gemfile.lock') }}
58+
key: root-gem-cache-${{ matrix.ruby }}-${{ hashFiles('Gemfile.lock') }}
5259
- name: Install Ruby Gems
5360
run: bundle check --path=vendor/bundle || bundle _2.4.9_ install --path=vendor/bundle --jobs=4 --retry=3
5461
- run: yarn

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@
22

33
source "http://rubygems.org"
44

5+
# Nokogiri version constraints for different Ruby versions
6+
# Ruby 3.0+ can use nokogiri 1.17.x which provides better compatibility
7+
# Ruby 2.7 uses gemfiles/ruby27.gemfile with nokogiri 1.15.x
8+
gem "nokogiri", "~> 1.17.0" if RUBY_VERSION >= "3.0"
9+
510
gemspec

Gemfile.lock

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ GEM
171171
net-smtp (0.5.0)
172172
net-protocol
173173
nio4r (2.7.3)
174-
nokogiri (1.15.7-x86_64-darwin)
174+
nokogiri (1.17.2-x86_64-darwin)
175175
racc (~> 1.4)
176-
nokogiri (1.15.7-x86_64-linux)
176+
nokogiri (1.17.2-x86_64-linux)
177177
racc (~> 1.4)
178178
notiffany (0.1.3)
179179
nenv (~> 0.1)
@@ -186,7 +186,7 @@ GEM
186186
byebug (~> 11.0)
187187
pry (~> 0.10)
188188
public_suffix (4.0.6)
189-
racc (1.6.2)
189+
racc (1.8.1)
190190
rack (2.2.6.4)
191191
rack-test (2.0.2)
192192
rack (>= 1.3)
@@ -268,6 +268,7 @@ DEPENDENCIES
268268
jbuilder
269269
listen (~> 3.0.0)
270270
minitest-retry
271+
nokogiri (~> 1.17.0)
271272
package_json
272273
pry-byebug (~> 3.8.0)
273274
rails (~> 7.0.7, >= 7.0.7.2)

0 commit comments

Comments
 (0)