Defect #37394
openuninitialized constant Redmine::WikiFormatting::CommonMark::HTML (NameError)
0%
Description
There appears to exist a loading issue, probably connected to the Zeitwerk loader, which has now been reported twice in the forums:
1.
2.
The exception raised in both the reports is "uninitialized constant Redmine::WikiFormatting::CommonMark::HTML (NameError)
".
It gets triggered by source:/tags/5.0.2/lib/redmine/wiki_formatting/common_mark/external_links_filter.rb#L27.
I don't know if this can be reproduced and if so how, but I thought that given that it is the same exception in both the reports, it might be something that has to be investigated and fixed if necessary.
Updated by Azamat Hackimov over 2 years ago
I think problem is that in Gemfile common_mark group described as optional, but really it can't be disabled, so effectively you have to install all gems for common_mark group in order to launch Redmine 5.
Updated by Joachim Mathes 10 months ago
I can confirm that behavior.
My local development environment works fine. But when I try to run Redmine in a bitnami/ruby container, it fails with a corresponding error regarding a plugin. Even when I remove all plugins Redmine fails with/lib/redmine/wiki_formatting/markdown/formatter.rb:25:in `<module:Markdown>': uninitialized constant Redmine::WikiFormatting::Markdown::Redcarpet (NameError)
despite
- the same Redmine version 5.1.1
- the same Ruby version 3.2.2
- the same bundler version 2.4.19
- the same run command
bundle exec rails server --environment=development
- the same Gemfile.lock and thus the same gem versions.
- e.g. Rails 6.1.7.6
Any help is appreciated.
Edit (08.01.2024)¶
I found the error(s) and fixed them. But first of all I would like to share, that running
bundle exec rails zeitwerk:check
helped a lot to check if the error still exists. Now let's have a look at the fixes
- Obviously
uninitialized constant Redmine::WikiFormatting::Markdown::Redcarpet (NameError)
is related to Markdown. But our Dockerfile excluded markdown:
BUNDLE_WITHOUT=...:markdown:...
. Thus, removingmarkdown
from the exclude list fixed the error. - But I still had another issue with a RedmineUP plugin:
redmine_contacts
NameError: uninitialized constant CalendarsHelper (NameError) Object.const_get(camel_cased_word) ^^^^^^^^^^ Did you mean? CalendarsController /app/plugins/redmine_contacts/app/controllers/deals_controller.rb:50:in `<class:DealsController>'
Well, that one could actually be fixed easily by updating from version 4.3.7 to version 4.3.8. What you must know is, thatredmine_contacts
is namedredmine_crm
on RedmineUp's download page.