Cant precompile assets

Infos:

  • Used Zammad version: 5.0.x
  • Used Zammad installation type: docker-compose
  • Operating system: Ubuntu 20.04.3 LTS
  • Browser + version: Firefox 94.0

I wanna change the colors of admin UI so I added a custom css to /var/lib/docker/volumes/zammad-docker-compose_zammad-data/_data/app/assets/stylesheets/custom/custom.css.
I know that the next step is to compile the assets. Using Portainer, I executed the command rails r rake assets:precompile

Expected behavior:

  • assets should compile

Actual behavior:

  • Traceback (most recent call last):
    33: from bin/rails:9:in <main>' 32: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require’
    31: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi' 30: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register’
    29: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi' 28: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require’
    27: from /usr/local/bundle/gems/railties-6.0.4.1/lib/rails/commands.rb:18:in <main>' 26: from /usr/local/bundle/gems/railties-6.0.4.1/lib/rails/command.rb:46:in invoke’
    25: from /usr/local/bundle/gems/railties-6.0.4.1/lib/rails/command/base.rb:69:in perform' 24: from /usr/local/bundle/gems/thor-1.1.0/lib/thor.rb:392:in dispatch’
    23: from /usr/local/bundle/gems/thor-1.1.0/lib/thor/invocation.rb:127:in invoke_command' 22: from /usr/local/bundle/gems/thor-1.1.0/lib/thor/command.rb:27:in run’
    21: from /usr/local/bundle/gems/railties-6.0.4.1/lib/rails/commands/runner/runner_command.rb:33:in perform' 20: from /usr/local/bundle/gems/railties-6.0.4.1/lib/rails/command/actions.rb:14:in require_application_and_environment!’
    19: from /usr/local/bundle/gems/railties-6.0.4.1/lib/rails/command/actions.rb:22:in require_application!' 18: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require’
    17: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi' 16: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register’
    15: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi' 14: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require’
    13: from /opt/zammad/config/application.rb:19:in <main>' 12: from /opt/zammad/config/application.rb:19:in select’
    11: from /opt/zammad/config/application.rb:20:in block in <main>' 10: from /usr/local/bundle/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:in require’
    9: from /usr/local/bundle/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:291:in load_dependency' 8: from /usr/local/bundle/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:in block in require’
    7: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require' 6: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi’
    5: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' 4: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi’
    3: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require' 2: from /usr/local/bundle/gems/execjs-2.8.1/lib/execjs.rb:4:in
    1: from /usr/local/bundle/gems/execjs-2.8.1/lib/execjs.rb:5:in <module:ExecJS>' /usr/local/bundle/gems/execjs-2.8.1/lib/execjs/runtimes.rb:58:in autodetect’: Could not find a JavaScript runtime. See GitHub - rails/execjs: Run JavaScript code from Ruby for a list of available runtimes. (ExecJS::RuntimeUnavailable)
    zammad@74ea63969404:~$ ls
    CHANGELOG.md Gemfile Guardfile LICENSE-3RD-PARTY.txt Procfile README.md VERSION bin config contrib gulpfile.js log public tmp
    CREDITS Gemfile.lock LICENSE LICENSE-ICONS-3RD-PARTY.json Procfile.frontend Rakefile app browserlist config.ru db lib package.json script vendor
    zammad@74ea63969404:~$ cd bin
    zammad@74ea63969404:~/bin$ ls
    bundle rails rake rspec setup spring update yarn
    zammad@74ea63969404:~/bin$ rails r rake assets:precompile
    Traceback (most recent call last):
    33: from bin/rails:9:in <main>' 32: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require’
    31: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi' 30: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register’
    29: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi' 28: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require’
    27: from /usr/local/bundle/gems/railties-6.0.4.1/lib/rails/commands.rb:18:in <main>' 26: from /usr/local/bundle/gems/railties-6.0.4.1/lib/rails/command.rb:46:in invoke’
    25: from /usr/local/bundle/gems/railties-6.0.4.1/lib/rails/command/base.rb:69:in perform' 24: from /usr/local/bundle/gems/thor-1.1.0/lib/thor.rb:392:in dispatch’
    23: from /usr/local/bundle/gems/thor-1.1.0/lib/thor/invocation.rb:127:in invoke_command' 22: from /usr/local/bundle/gems/thor-1.1.0/lib/thor/command.rb:27:in run’
    21: from /usr/local/bundle/gems/railties-6.0.4.1/lib/rails/commands/runner/runner_command.rb:33:in perform' 20: from /usr/local/bundle/gems/railties-6.0.4.1/lib/rails/command/actions.rb:14:in require_application_and_environment!’
    19: from /usr/local/bundle/gems/railties-6.0.4.1/lib/rails/command/actions.rb:22:in require_application!' 18: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require’
    17: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi' 16: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register’
    15: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi' 14: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require’
    13: from /opt/zammad/config/application.rb:19:in <main>' 12: from /opt/zammad/config/application.rb:19:in select’
    11: from /opt/zammad/config/application.rb:20:in block in <main>' 10: from /usr/local/bundle/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:in require’
    9: from /usr/local/bundle/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:291:in load_dependency' 8: from /usr/local/bundle/gems/activesupport-6.0.4.1/lib/active_support/dependencies.rb:324:in block in require’
    7: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require' 6: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi’
    5: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' 4: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi’
    3: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require' 2: from /usr/local/bundle/gems/execjs-2.8.1/lib/execjs.rb:4:in
    1: from /usr/local/bundle/gems/execjs-2.8.1/lib/execjs.rb:5:in <module:ExecJS>' /usr/local/bundle/gems/execjs-2.8.1/lib/execjs/runtimes.rb:58:in autodetect’: Could not find a JavaScript runtime. See GitHub - rails/execjs: Run JavaScript code from Ruby for a list of available runtimes. (ExecJS::RuntimeUnavailable)

Steps to reproduce the behavior:

  • Install zammad using docker-compose
  • execute the command rails r rake assets:precompile on the rails container

Is there any way to precompile assets in docker-compose setup? Thanks

Nevermind sorry.
Doesn’t seem the container is shipped with nodejs - but I’m no docker expert:

Custom changes to docker containers are -in my opinion- a bad idea any way as you have to beg for containers mercy.

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