Skip to content

Commit 0e84ad3

Browse files
committed
Add cgi gem to Gemfile until newer rouge gem is released
This commit addresses this Rails CI Nightly failure below. https://buildkite.com/rails/rails-nightly/builds/2679#0198a53d-2b95-4767-95aa-e54f1297493d/1193-1197 - Errors addressed by this commit ``` $ ruby -v ruby 3.5.0dev (2025-08-12T14:43:46Z master c5c894c6e4) +PRISM [x86_64-linux] $ cd guides $ bundle install $ bundle exec rake guides:lint ... snip ... Generating active_record_validations.md as active_record_validations.html Generating 5_1_release_notes.md as 5_1_release_notes.html Generating asset_pipeline.md as asset_pipeline.html /home/yahonda/.local/share/mise/installs/ruby/trunk/lib/ruby/gems/3.5.0+2/gems/rouge-4.5.1/lib/rouge/lexer.rb:55:in 'Rouge::Lexer.lookup_fancy': undefined method 'parse' for class CGI (NoMethodError) opts = CGI.parse(opts || '').map do |k, vals| ^^^^^^ from /home/yahonda/.local/share/mise/installs/ruby/trunk/lib/ruby/gems/3.5.0+2/gems/rouge-4.5.1/lib/rouge/lexer.rb:95:in 'Rouge::Lexer.find_fancy' from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/markdown/renderer.rb:35:in 'RailsGuides::Markdown::Renderer#block_code' from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/markdown.rb:90:in 'Redcarpet::Markdown#render' from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/markdown.rb:90:in 'RailsGuides::Markdown#generate_body' from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/markdown.rb:28:in 'RailsGuides::Markdown#render' from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:214:in 'RailsGuides::Generator#generate_guide' from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:108:in 'block in RailsGuides::Generator#generate_guides' from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:106:in 'Array#each' from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:106:in 'RailsGuides::Generator#generate_guides' from /home/yahonda/src/github.com/rails/rails/guides/rails_guides/generator.rb:52:in 'RailsGuides::Generator#generate' from rails_guides.rb:31:in '<main>' rake aborted! Command failed with status (1): [/home/yahonda/.local/share/mise/installs/ruby/trunk/bin/ruby -Eutf-8:utf-8 rails_guides.rb] /home/yahonda/src/github.com/rails/rails/guides/Rakefile:33:in 'block (3 levels) in <top (required)>' /home/yahonda/.local/share/mise/installs/ruby/trunk/bin/bundle:25:in '<main>' Tasks: TOP => guides:lint => guides:lint:check_links (See full trace by running task with --trace) $ ``` This workaround commit can be reverted when newer version of rouge gem is relased including rouge-ruby/rouge#2131 - Ruby 3.5 removes cgi by default https://bugs.ruby-lang.org/issues/21258 ruby/ruby#13275
1 parent 2ca2634 commit 0e84ad3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ group :doc do
6969
gem "redcarpet", "~> 3.6.1", platforms: :ruby
7070
gem "w3c_validators", "~> 1.3.6"
7171
gem "rouge"
72+
# Workaround until https://github.com/rouge-ruby/rouge/pull/2131 is merged and released
73+
gem "cgi", require: false
7274
gem "rubyzip", "~> 2.0"
7375
end
7476

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ GEM
182182
rack-test (>= 0.6.3)
183183
regexp_parser (>= 1.5, < 3.0)
184184
xpath (~> 3.2)
185+
cgi (0.5.0)
185186
chef-utils (18.6.2)
186187
concurrent-ruby
187188
childprocess (5.1.0)
@@ -752,6 +753,7 @@ DEPENDENCIES
752753
brakeman
753754
bundler-audit
754755
capybara (>= 3.39)
756+
cgi
755757
connection_pool
756758
cssbundling-rails
757759
dalli (>= 3.0.1)

0 commit comments

Comments
 (0)