Project

General

Profile

Actions

Defect #36892

closed

Redmine does not start when installed --without markdown

Added by Holger Just almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Gems support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

When installing Redmine 5.0.0 with

bundle install --without markdown

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 the CommonMark 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:

  • 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.

Related issues

Related to Redmine - Feature #37119: Drop redcarpet dependency for common_mark formatterClosedMarius BĂLTEANU

Actions
Actions

Also available in: Atom PDF