Project

General

Profile

Actions

Defect #40859

closed

server start fails upon update to Ruby 3.1.6

Defect #40859: server start fails upon update to Ruby 3.1.6

Added by Rob Maris over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Resolution:
Invalid
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?

Updated by Vincent Robert over 2 years ago Actions #1

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.

Updated by Rob Maris over 2 years ago Actions #2

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

Updated by Go MAEDA over 1 year ago Actions #3

  • Status changed from New to Closed
  • Resolution set to Invalid
Actions

Also available in: PDF Atom