Defect #32318

Redmine 4.0 can not be installed in a sub-URI any more

Added by Robert Auer about 1 year ago. Updated about 1 year ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Resolution:Invalid Affected version:4.0.4

Description

Hi!

I tried to upgrade my Redmine-installation from 3.4 to 4.0. Until now it was configured to run in the sub-URI "/redmine" by setting "RedmineApp::Application.routes.default_scope = '/redmine'" in the config/environment.rb. This does not work any more in Redmine 4.0 and leads to the "The direct method can't be used..." error described in http://www.redmine.org/issues/31085. But all the solutions described there either aren't applicable in my case (I run Redmine in a Docker container with alpine linux and therefore have no systemd) or do not work. This is unfortunately also the case with all the tips described in http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI which leaves me with no option to run Redmine in a sub-URI any more.

I tried the same with the official Redmine Docker container from Dockerhub and it shows the same errors when a sub-URI is configured.

Environment:
PostgreSQL 9.6.10
ruby 2.5.5p157 (2019-03-15 revision 67260)
Rails 5.2.3
Redmine 4.0.4 in alpine linux 3.9.4 Docker container

Can anyone tell me if there is another way to do it or is there simply no way in Redmine 4.0 any more?

Regards,

Robert


Related issues

Duplicates Redmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0 Closed

History

#1 Updated by Robert Auer about 1 year ago

  • Status changed from New to Resolved

Actually, there is a way:

  • Set environment variable RAILS_RELATIVE_URL_ROOT=/redmine
  • Adapt config/environment.rb:

Rails.application.initialize!

ActionController::Base.relative_url_root = RedmineApp::Application.routes.default_scope
Redmine::Utils::relative_url_root = RedmineApp::Application.routes.default_scope

ENV['RAILS_RELATIVE_URL_ROOT'] = "/redmine" 
Redmine::Utils::relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT']

  • Adapt config.ru:
    map ENV['RAILS_RELATIVE_URL_ROOT'] || '/' do
      run Rails.application
    end
    

Sorry guys, my bad.

#2 Updated by Marius BALTEANU about 1 year ago

  • Duplicates Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0 added

#3 Updated by Marius BALTEANU about 1 year ago

  • Status changed from Resolved to Closed
  • Resolution set to Invalid

Robert Auer wrote:

Actually, there is a way:

  • Set environment variable RAILS_RELATIVE_URL_ROOT=/redmine
  • Adapt config/environment.rb:

[...]

  • Adapt config.ru:
    [...]

Sorry guys, my bad.

No problem, thanks for the feedback.

Also available in: Atom PDF