Bad gateway /kernel_require.rb:29:in `require': cannot load such file -- rails/commands

Zammad Version: 6.1.0 package deb
OS: Ubuntu 22.04 server

After apt upgrade Zammad gives “502 bad gateway”. Console commands and db_migration throws following error:

root@nc:/home/user# zammad run rails r ‘p Setting.get(“system_bcc”)’
/opt/zammad/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require': cannot load such file -- rails/commands (LoadError) from /opt/zammad/bin/rails:5:in

/opt/zammad/bin/rails brings
/usr/bin/env: ‘ruby’: No such file or directory

Do I need to install ruby via apt or not?

Maybe the reason ist that /usr/bin/env: ‘ruby’ is not connected to

This call seems to work
root@nc$ /opt/zammad/vendor/ruby-3.1.3/bin/ruby -v
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]

So ruby shipped with Zammad seems to work

I have the same issue: Upgrade from 6.0.X to 6.1 system is broken

How can I connect /usr/bin/env to ruby?

I made a blank install for comparison on a test machine. “zammad run rails …” works there and web ui is online but “/usr/bin/env: ‘ruby’: No such file or directory” also appears.

So I gues this is not the problem.

I removed zammad package and the zammad user + /home/zammad and reinstalled. Problem remains and error occurs during package post installation:

root@nc:/home/user# /opt/zammad/contrib/
# Enforcing Redis...
# Creating Redis bootstart
Synchronizing state of redis-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable redis-server
# Starting Redis server
# Redis server is running.
# (Re)creating init scripts
Nothing to do.
Nothing to do.
Nothing to do.
# Enabling Zammad on boot
# Stopping Zammad
# Clear cache...
/opt/zammad/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require': cannot load such file -- rails/commands (LoadError)
        from /opt/zammad/bin/rails:5:in `<main>'
# database.yml found. Updating db...
rake aborted!
LoadError: cannot load such file -- rails/all
/opt/zammad/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'

The 4 zammad services report running, but I get no connection to “localhost:3000”. I gues that the service does not start correctly because of rails is not working.

I can confirm this.

What I have found that active_support module is not activated. Also I could not find it in /opt/zammad/Gemfile

There is a new build in the repository but same issue with 6.1.0-1697088139.2ca40c65.jammy

For me the solution is at the moment a downgrade:

FYI: This might be specific to the Ubuntu repository versions of Zammad, I have been upgrading on a Debian machine using the Debian bookworm repository versions ( 12 main) and have not encountered these issues at all.


This worked for me, too.

apt install zammad=6.0.0-1692374817.3b8df7cc.jammy

You saved my day! Thanks very much.

1 Like

Hello everyone. Thanks for the report. I just tried this on fresh cloud servers. Both

  • the direct installation of Zammad 6.1 (latest version 6.1.0-1697105813.b8ceb098.jammy)
  • the installation of Zammad 6.0 and then subsequent update to 6.1

worked just fine. No issues running rails console or the mentioned script. Is there anything else we can try to reproduce the error?


Just out of curiosity, what is the output of the following command for the affected users?

zammad config:get PATH

I did run into most likely the same issue a few weeks ago.

What I noticed is, that it seemed like that bootsnap did not invalidate its cache. Deleting /opt/zammad/tmp/cache to force bootsnap to start from a clean slate helped.


Thanks for your reply. Removing the content of /opt/zammad/tmp/cache did the trick!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.