Redmine - Defect #36892
Redmine does not start when installed --without markdown2022-04-04 20:26 - Holger Just

ステータス:

Closed

開始日:

優先度:

Normal期日:担当者:

Marius B

カテゴリ:

Gems support

対象バージョン:5.0.1

Resolution:

FixedLTEANU

進捗率:

0%

予定工数:

0.00時間Affected version:

5.0.0

説明
When installing Redmine 5.0.0 withbundleinstall--withoutmarkdown

it fails with the following stack trace:
A formatter class is required
˜/redmine-5.0.0/lib/redmine/wiki̲formatting.rb:45:in ̀register'˜/redmine-5.0.0/lib/redmine/preparation.rb:400:in ̀block in prepare'˜/redmine-5.0.0/lib/redmine/wiki̲formatting.rb:31:in ̀map'˜/redmine-5.0.0/lib/redmine/preparation.rb:396:in ̀prepare'˜/redmine-5.0.0/config/initializers/30-redmine.rb:11:in ̀block in <top (required)>'˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/callbacks.rb:427:in ̀instance̲exec'
˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/callbacks.rb:427:in ̀block in make̲lambda'
˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/callbacks.rb:198:in ̀block (2 levels) in halting'˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/callbacks.rb:604:in ̀block (2 levels) in default̲terminator'
˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/callbacks.rb:603:in ̀catch'˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/callbacks.rb:603:in ̀block in default̲terminator'
˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/callbacks.rb:199:in ̀block in halting'˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/callbacks.rb:512:in ̀block in invoke̲before'
˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/callbacks.rb:512:in ̀each'˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/callbacks.rb:512:in ̀invoke̲before'
˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/callbacks.rb:105:in ̀run̲callbacks'
˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/reloader.rb:88:in ̀prepare!'˜/.gem/ruby/2.7.5/gems/railties-6.1.4.7/lib/rails/application/finisher.rb:124:in ̀block in <module:Finisher>'˜/.gem/ruby/2.7.5/gems/railties-6.1.4.7/lib/rails/initializable.rb:32:in ̀instance̲exec'
˜/.gem/ruby/2.7.5/gems/railties-6.1.4.7/lib/rails/initializable.rb:32:in ̀run'˜/.gem/ruby/2.7.5/gems/railties-6.1.4.7/lib/rails/initializable.rb:61:in ̀block in run̲initializers'
˜/.gem/ruby/2.7.5/gems/railties-6.1.4.7/lib/rails/initializable.rb:60:in ̀run̲initializers'
˜/.gem/ruby/2.7.5/gems/railties-6.1.4.7/lib/rails/application.rb:391:in ̀initialize!'˜/redmine-5.0.0/config/environment.rb:16:in ̀<top (required)>'˜/.gem/ruby/2.7.5/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in ̀require'˜/.gem/ruby/2.7.5/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in ̀require'˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/dependencies.rb:332:in ̀block in require'˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/dependencies.rb:299:in ̀load̲dependency'
˜/.gem/ruby/2.7.5/gems/activesupport-6.1.4.7/lib/active̲support/dependencies.rb:332:in ̀require'˜/.gem/ruby/2.7.5/gems/railties-6.1.4.7/lib/rails/application.rb:367:in ̀require̲environment!'
˜/.gem/ruby/2.7.5/gems/railties-6.1.4.7/lib/rails/application.rb:533:in ̀block in run̲tasks̲blocks'
˜/.gem/ruby/2.7.5/gems/rake-13.0.6/exe/rake:27:in ̀<top (required)>'˜/.gem/ruby/2.7.5/bin/bundle:25:in ̀load'
˜/.gem/ruby/2.7.5/bin/bundle:25:in ̀<main>'Tasks: TOP => db:migrate => db:load̲config => environment
Although the redcarpet gem is not a strict requirement with the commonmark gem, in Redmine it is currently required by theCommonMark formatter because Redmine::WikiFormatting::CommonMark::Formatter <Redmine::WikiFormatting::Markdown::Formatter. The file where the Markdown formatter is defined, namely
lib/redmine/wiki̲formatting/markdown/formatter.rb however defines a sub-class of a Redcloth class. This fails without Redcloth
being available.
To solve this, we could either:2024-09-15

1/3

include redcloth in the common̲mark group in the Gemfile
or extract the markdown parts into different files / modules so that the common̲mark stuff can be loaded without Redcloth
being present.
関連するチケット:
関連している Redmine - Feature #37119: Drop redcarpet dependenc...

Closed

関係しているリビジョン
リビジョン 21575 - 2022-05-15 12:54 - Marius B

LTEANU

Add redcarpet gem to common̲mark group because the common̲mark implementation requires it and Redmine won't start when it is installed
without markdown group (#36892).
リビジョン 21576 - 2022-05-15 12:58 - Marius B

LTEANU

Merged r21575 to 5.0-stable (#36892).

履歴#1 - 2022-04-05 08:56 - Marius B

LTEANU- ステータス を New から Confirmed に変更- 対象バージョン を 5.0.1 にセット
#2 - 2022-04-05 08:57 - Marius B

LTEANU

Holger Just wrote:
To solve this, we could either:include redcloth in the common̲mark group in the Gemfile
or extract the markdown parts into different files / modules so that the common̲mark stuff can be loaded without Redcloth being
present.

I think the second option sounds better.
#3 - 2022-05-12 08:04 - Marius B- 担当者 を Marius B

LTEANULTEANU にセット

I took a look again on this and for 5.0.1 it's better to go with option 1 because it doesn't require to many code changes. I'm going to commit thefollowing change:root@0f0593a01efb:/work# git diff
diff --git a/Gemfile b/Gemfile
index 25134c106..64fbd4fc6 100644--- a/Gemfile+++ b/Gemfile@@ -50,6 +50,9 @@group :common̲mark do
gem "commonmarker", (Gem.ruby̲version < Gem::Version.new('2.6.0') ? '0.21.0' : '0.23.1')
gem "sanitize", "˜> 6.0"
gem 'deckar01-task̲list', '2.3.2'+# ToDo: Remove redcarpet dependency when common̲mark is decoupled from markdown.
+# See defect (#36892) for more details.
+
gem 'redcarpet', '˜> 3.5.1'
end
For version 5.1, I'll add a new tichet to implement the second option.
#4 - 2022-05-12 16:01 - Holger Just
I don't think it's a good idea to define the redcarpet gem two times (in the markdown and commonmark groups) as this will cause a warning frombundler and could result in errors later when the version is updated in only one place.
Instead, it should probably be extracted as e.g.
gem'redcarpet','˜>

3.5.1',:groups#5 - 2022-05-15 12:57 - Marius B=>[:markdown,:common̲mark]LTEANU- Resolution を Fixed にセット

2024-09-15

2/3

Thanks Holger, I didn't see the warning.
I've committed now the change and I've created (#37119) to properly fix this.
#6 - 2022-05-15 12:58 - Marius B

LTEANU- ステータス を Confirmed から Closed に変更#7 - 2023-05-22 17:28 - Holger Just
- 関連している Feature #37119: Drop redcarpet dependency for common̲mark formatter を追加

2024-09-15

3/3