Issues with running redmine on a Debian 10 Apache server
I have been running redmine for a longtime, installing it with apt-get. Recently I upgraded to Debian 10 and lost the installation owing to the issues in porting redmine to the new bullseye repository.
Therefore I decided to install redmine using the procedure outlined in the wiki: [[https://www.redmine.org/projects/redmine/wiki/RedmineInstall]]
I created a redmine user as a member of www-data and downloaded and extracted version 4.2 in the directory /opt/redmine, installed all the necessary packages, edited the
config.yml file and migrated the SQL database. These are the versions that I have:
> rails -v Rails 220.127.116.11 > ruby -v ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux-gnu] > gem -v 3.2.5
Then I tested the server in localhost port 3000 with
bundle exec rails server webrick -e production
Redmine works like a charm, I can login and all my projects, posts, and issues are there.
Then I tried to set up redmine in the apache server, I updated passenger
and edited the passenger.conf
<IfModule mod_passenger.c> PassengerRoot /var/lib/gems/2.7.0/gems/passenger-6.0.12 PassengerDefaultRuby /usr/bin/ruby2.7 PassengerDefaultUser www-data </IfModule>
LoadModule passenger_module /var/lib/gems/2.7.0/gems/passenger-6.0.12/buildout/apache2/mod_passenger.so
Finally I created a link to the www directory:
ln -s /opt/redmine/public /var/www/redmine
And created the redmine.conf in apache:
<Location /redmine> RailsEnv production PassengerFriendlyErrorPages on RackBaseURI /redmine Options -MultiViews </Location>
Sadly I get an error when accessing my server redmine location
superclass mismatch for class StringIO (TypeError) /usr/lib/ruby/2.7.0/openssl/config.rb:14:in `require' /usr/lib/ruby/2.7.0/openssl/config.rb:14:in `<top (required)>' /usr/lib/ruby/2.7.0/openssl.rb:18:in `require' /usr/lib/ruby/2.7.0/openssl.rb:18:in `<top (required)>' /opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.6/lib/active_support/key_generator.rb:4:in `require' /opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.6/lib/active_support/key_generator.rb:4:in `<top (required)>' /opt/redmine/vendor/bundle/ruby/2.7.0/gems/railties-5.2.6/lib/rails/application.rb:6:in `require' /opt/redmine/vendor/bundle/ruby/2.7.0/gems/railties-5.2.6/lib/rails/application.rb:6:in `<top (required)>' /opt/redmine/vendor/bundle/ruby/2.7.0/gems/railties-5.2.6/lib/rails.rb:14:in `require' /opt/redmine/vendor/bundle/ruby/2.7.0/gems/railties-5.2.6/lib/rails.rb:14:in `<top (required)>' /opt/redmine/config/application.rb:5:in `require' /opt/redmine/config/application.rb:5:in `<top (required)>' /opt/redmine/config/environment.rb:5:in `require' /opt/redmine/config/environment.rb:5:in `<top (required)>' config.ru:3:in `require' config.ru:3:in `block in <main>' /opt/redmine/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `instance_eval' /opt/redmine/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `initialize' config.ru:1:in `new' config.ru:1:in `<main>' /var/lib/gems/2.7.0/gems/passenger-6.0.12/src/helper-scripts/rack-preloader.rb:101:in `eval' /var/lib/gems/2.7.0/gems/passenger-6.0.12/src/helper-scripts/rack-preloader.rb:101:in `preload_app' /var/lib/gems/2.7.0/gems/passenger-6.0.12/src/helper-scripts/rack-preloader.rb:189:in `block in <module:App>' /var/lib/gems/2.7.0/gems/passenger-6.0.12/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:397:in `run_block_and_record_step_progress' /var/lib/gems/2.7.0/gems/passenger-6.0.12/src/helper-scripts/rack-preloader.rb:188:in `<module:App>' /var/lib/gems/2.7.0/gems/passenger-6.0.12/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>' /var/lib/gems/2.7.0/gems/passenger-6.0.12/src/helper-scripts/rack-preloader.rb:29:in `<main>'
Here are the printouts of the commands
gem env as user redmine inside
RubyGems Environment: - RUBYGEMS VERSION: 3.2.5 - RUBY VERSION: 2.7.4 (2021-07-07 patchlevel 191) [x86_64-linux-gnu] - INSTALLATION DIRECTORY: /var/lib/gems/2.7.0 - USER INSTALLATION DIRECTORY: /opt/redmine/.local/share/gem/ruby/2.7.0 - RUBY EXECUTABLE: /usr/bin/ruby2.7 - GIT EXECUTABLE: /usr/bin/git - EXECUTABLE DIRECTORY: /usr/local/bin - SPEC CACHE DIRECTORY: /opt/redmine/.local/share/gem/specs - SYSTEM CONFIGURATION DIRECTORY: /etc - RUBYGEMS PLATFORMS: - ruby - x86_64-linux - GEM PATHS: - /var/lib/gems/2.7.0 - /opt/redmine/.local/share/gem/ruby/2.7.0 - /usr/local/lib/ruby/gems/2.7.0 - /usr/lib/ruby/gems/2.7.0 - /usr/lib/x86_64-linux-gnu/ruby/gems/2.7.0 - /usr/share/rubygems-integration/2.7.0 - /usr/share/rubygems-integration/all - /usr/lib/x86_64-linux-gnu/rubygems-integration/2.7.0 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - https://rubygems.org/ - SHELL PATH: - /opt/redmine/bin - /usr/local/bin - /usr/bin - /bin - /usr/local/games - /usr/games - /usr/local/mdsplus/bin
I get an error:
-bash: /opt/redmine/script/about.: No such file or directory
but I do have a
/bin/about in the directory so I ran instead:
sh: 1: hg: not found sh: 1: cvs: not found sh: 1: bzr: not found Environment: Redmine version 4.2.3.stable Ruby version 2.7.4-p191 (2021-07-07) [x86_64-linux-gnu] Rails version 5.2.6 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Subversion 1.14.1 Git 2.30.2 Filesystem Redmine plugins: no plugin installed
Do note that I downgraded rails in the/opt/redmine directory to version 5.2.6 (as root I ran
gem install rails -v=5.2 inside /opt/redmine) as a try to get things fixed (tried both versions, no luck), hence why rails as user redmine appears as 5.2.6 whereas rails as root is 18.104.22.168
Any help is appreciated, thank you.
Thank you for all the information you put in your request. This helps for getting ideas about the reason of your problem.
Starting at the first error message:
superclass mismatch for class StringIO (TypeError)
StringIO is a class of rubys standard library. A superclass mismatch occurs when there are multiple classes named StringIO and due to this it is not quite clear which one should be used.
When I look at your error stack then I find a lot of different pathes for ruby and ruby gems.
1) /var/lib/gems/2.7.0/gems/ 2) /opt/redmine/vendor/bundle/ruby/2.7.0/gems/ 3) /usr/lib/ruby/2.7.0/
I guess that you have the required class at several places which are all in your PATH and hence recognized. I would try to clean this up a little bit. It seems as if you have bundled all gems into
Try to stick with that directory or its corresponding path as stated in GEM PATHS in your PassengerDefaultRuby configuration. Maybe it will work with:
<IfModule mod_passenger.c> PassengerRoot /var/lib/gems/2.7.0/gems/passenger-6.0.12 PassengerDefaultRuby /opt/redmine/.local/share/gem/ruby/2.7.0 PassengerDefaultUser www-data </IfModule>
RE: Issues with running redmine on a Debian 10 Apache server - Added by Mario Lino da Silva 2 months ago
Thanks for the help Liane, I see, I should try for the server to load the gems in /opt/redmine.
With this said, and although
gem env does mention
/opt/redmine/.local/share/gem/ruby/2.7.0 changing the configuration of passenger did not work as I seem to not have a .local subfolder in my
/opt/redmine folder, did I miss some command to create this somewhere? I am a bit confused gem env mentions it as a path although it does not exist.
I checked and have all my local gems in
however putting this path on PassengerDefaultRuby yields me an error
/bin/sh: 1: exec: /opt/redmine/vendor/bundle/ruby/2.7.0/gems: Permission denied
although I do have 755 permissions on this folder (and all other ones).
Do you have any more suggestions on what to try next?
Your help is appreciated,
There are some more things you could check:
i) Navigate to the root of your Redmine instance and run
If you get a path different from that you have tried to configure for passenger than try that one.
ii) If there are still permission problems than check also whether the group of passenger is the same in your path returned by which ruby.
iii) Maybe you should also set the gem path for passenger. Since you have a lot of pathes registered you could try to find the relevant one with the following command running at the instance root directory:
gem list bundler -d
and set that path in the passenger configuration like so:
SetEnv GEM_PATH (the-path-you-get-from-the-command-above)
Please let me know whether something is helpful or when you try some other things what was helpful of them.