That Weird Rails 8 + Tailwind + Kamal Bug on macOS
Edu Depetris
- Aug 28, 2025- Ruby On Rails
- Tailwindcss
- Kamal
- Bug
If you’re deploying a Rails 8 app with Tailwind CSS using Kamal from macOS to a Linux server, chances are you’ll hit one of those head-scratching bugs that make you question everything.
#17 [build 6/6] RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile #17 3.110 ≈ tailwindcss v4.1.12 #17 3.110 #17 3.201 Error: Cannot apply unknown utility class `gap-x-2` #17 3.207 bin/rails aborted! #17 3.207 Command failed with exit 1: /usr/local/bundle/ruby/3.3.0/gems/tailwindcss-ruby-4.1.12-x86_64-linux-gnu/exe/x86_64-linux-gnu/tailwindcss #17 3.207 #17 3.207 Tasks: TOP => assets:precompile => tailwindcss:build #17 3.207 (See full trace by running task with --trace) #17 ERROR: process "/bin/sh -c SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile" did not complete successfully: exit code: 1 Dockerfile:49 -------------------- 47 | 48 | # Precompiling assets for production without requiring secret RAILS_MASTER_KEY 49 | >>> RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile 50 | 51 | -------------------- ERROR: failed to build: failed to solve: process "/bin/sh -c SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile" did not complete successfully: exit code: 1 View build details: docker-desktop://dashboard/build/kamal-local-docker-container/kamal-local-docker-container0/ceiqu1e90hzfs12b68uv5eq20 docker stderr: Nothing written
TLDR;
Open Docker > Settings > General and uncheck Use Rosetta for x86_64/amd64 emulation on Apple Silicon
This Github link provides context about the issue and the solution.
This link will give you a better idea about the weird bug and this one is the workaround.
🎉 Happy deploy!