Project

General

Profile

Sharing changes needed to port redmine_scm (SCM Creator) to Redmine 6.1, Rails 7.2

Added by Peter Oberauer about 8 hours ago

First issue:

App 111313 output: Error: The application encountered the following error: cannot load such file -- creator/scm_creator (LoadError)

Second issue:

App 111721 output: Error: The application encountered the following error: uninitialized constant Adapters::GithubAdapter (NameError)

Third issue:

Still no "Create new repository" button

Fixes/Workarounds:

1. in redmine_scm/init.rb, change

require_dependency 'creator/scm_creator'
etc to
require_dependency File.dirname(FILE) + '/lib/creator/scm_creator'

2. add to the top:

if defined?(Rails) && Rails.respond_to?(:autoloaders)
Rails.autoloaders.main.ignore(File.expand_path("lib/adapters", dir))
Rails.autoloaders.main.ignore(File.expand_path("lib/creator", dir))
end

3. change

Rails.configuration.to_prepare do
to
Rails.application.config.after_initialize do

References

1. https://www.redmine.org/boards/2/topics/67113?r=67250#message-67250
2. GPT
3. https://github.com/rails/rails/issues/45176#issuecomment-1137138271