Project

General

Profile

Actions

Defect #40859

open

server start fails upon update to Ruby 3.1.6

Added by Rob Maris 5 months ago. Updated 5 months ago.

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

0%

Estimated time:
Resolution:
Affected version:

Description

After having installed redmine-5.1.3 onto my Debian 11 server, I encountered the problem that saving an issue results in error. Since I read that Ruby 2.7 is no longer supported, I decided to update to 3.1.6. using ruby-build en renv. Below, a quick switch between versions with server start respond is documented.

Correct server start in Ruby 2.7.4:

redmine@debian-rjm:~/redmine-5.1.3$ bundle exec rails server -e production
=> Booting WEBrick
=> Rails 6.1.7.8 application starting in production http://0.0.0.0:3000
=> Run `bin/rails server --help` for more startup options
[2024-06-19 10:24:58] INFO  WEBrick 1.6.1
[2024-06-19 10:24:58] INFO  ruby 2.7.4 (2021-07-07) [x86_64-linux-gnu]
[2024-06-19 10:24:58] INFO  WEBrick::HTTPServer#start: pid=356143 port=3000
^C[2024-06-19 10:25:14] INFO  going to shutdown ...
[2024-06-19 10:25:14] INFO  WEBrick::HTTPServer#start done.
Exiting
redmine@debian-rjm:~/redmine-5.1.3$ rails --version
Rails 6.1.7.8

Result after switching to 3.1.6:
redmine@debian-rjm:~/redmine-5.1.3$ rbenv local 3.1.6
redmine@debian-rjm:~/redmine-5.1.3$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Bundle complete! 42 Gemfile dependencies, 75 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
redmine@debian-rjm:~/redmine-5.1.3$ rails --version
Rails 6.1.7.8
redmine@debian-rjm:~/redmine-5.1.3$ bundle exec rails server -e production
Could not find server "". 
Run `bin/rails server --help` for more options.

I'm wondering about empty server name here.
Any hints regarding how to locate the problem?

Actions #1

Updated by Vincent Robert 5 months ago

WEBrick used to be included with Ruby itself before version 3.0. If you want to continue using it with Ruby 3.1, you'll need to add it to your Gemfile:

gem 'webrick'

However, WEBrick is not suitable for production environments because it is not a performant web server; it runs a single process with a single thread. Instead, you might consider using Puma, which is the current standard server.

Actions #2

Updated by Rob Maris 5 months ago

Vincent Robert wrote in #note-1:

However, WEBrick is not suitable for production environments because it is not a performant web server; it runs a single process with a single thread. Instead, you might consider using Puma, which is the current standard server.

Regarding gem 'webrick': excellent - thank you!

Regarding webrick: well, step 9 in the installation page hints on this route only to test. Until now, I did it this way to get things first configured in my redmine instance. After adding puma in Gemfile, the same command bundle exec rails server -e production shows up that puma is used now.
Anyway: on the installation page, I'm missing a step 11 that supplies info and pointers to production server function (e.g. Apache config to utilize proxy that uses port 3000 and of course https).

Actually I'm missing a pointer here to information of how to use Apache with proxy to get rid of the :3000 port and to allow https with Let's encrypt. Or using

Actions

Also available in: Atom PDF