Project

General

Profile

Actions

Defect #32318

closed

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

Added by Robert Auer about 5 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

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

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

Actions
Actions #1

Updated by Robert Auer about 5 years 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.

Actions #2

Updated by Marius BĂLTEANU about 5 years ago

  • Is duplicate of Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0 added
Actions #3

Updated by Marius BĂLTEANU about 5 years 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.

Actions #4

Updated by Tom Misilo over 3 years ago

There any chance this could be included in the project itself?

Actions

Also available in: Atom PDF