Ask A Question

Notifications

You’re not receiving notifications from this thread.

Running into render build error related to Tailwind

Adam Burgess asked in Rails

Following along with the Build a Blog lesson and currently trying to deploy on render. I can't seem to pass the below error during build - has anyone else seen this before? Locally tailwind is working as expected and I believe I have everything installed correctly.

My application.html.erb file has the following tag:
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>

Confirmed that app > assets > stylehseets contains an application.tailwind.css file.

Build error:

I, [2025-01-05T15:51:50.961531 #134] INFO -- : [ad1d71de-b3b8-4d04-8bc1-14936e44d1f2] Rendered layout layouts/application.html.erb (Duration: 100.0ms | Allocations: 2485)
info
I, [2025-01-05T15:51:50.961929 #134] INFO -- : [ad1d71de-b3b8-4d04-8bc1-14936e44d1f2] Completed 500 Internal Server Error in 200ms (ActiveRecord: 1.0ms | Allocations: 3948)
critical
F, [2025-01-05T15:51:50.963210 #134] FATAL -- : [ad1d71de-b3b8-4d04-8bc1-14936e44d1f2]
error
[ad1d71de-b3b8-4d04-8bc1-14936e44d1f2] ActionView::Template::Error (The asset "tailwind.css" is not present in the asset pipeline.

Reply

Did the assets:precompile step get run during deploy? That is what should compile the CSS file for production.

Reply

Yes - that step was included as a part of my build command on render.

I finally was able to get the build to succeed - the fix was to downgrade Tailwind from v3.1 to v2.0. I compared my repo to the learning-path-blog repo and noticed the version difference which did in fact fix the build.

Reply

Interesting. Do the deploy logs show any errors from 3.1?

Reply

No, nothing that specifically shouts out 3.1. Below is the error right from the log:

I, [2025-01-05T18:31:30.913718 #128]  INFO -- : [827e9eb0-3ee5-42d7-adc0-f898636a047b]   Rendered layout layouts/application.html.erb (Duration: 22.6ms | Allocations: 2472)
info
I, [2025-01-05T18:31:30.914011 #128]  INFO -- : [827e9eb0-3ee5-42d7-adc0-f898636a047b] Completed 500 Internal Server Error in 207ms (ActiveRecord: 2.9ms | Allocations: 3984)
critical
F, [2025-01-05T18:31:30.991453 #128] FATAL -- : [827e9eb0-3ee5-42d7-adc0-f898636a047b]   
error
[827e9eb0-3ee5-42d7-adc0-f898636a047b] ActionView::Template::Error (The asset "tailwind.css" is not present in the asset pipeline.
info
):
info
[827e9eb0-3ee5-42d7-adc0-f898636a047b]      5:     <meta name="viewport" content="width=device-width,initial-scale=1">
info
[827e9eb0-3ee5-42d7-adc0-f898636a047b]      6:     <%= csrf_meta_tags %>
info
[827e9eb0-3ee5-42d7-adc0-f898636a047b]      7:     <%= csp_meta_tag %>
info
[827e9eb0-3ee5-42d7-adc0-f898636a047b]      8:     <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
info
[827e9eb0-3ee5-42d7-adc0-f898636a047b]      9:   </head>
info
[827e9eb0-3ee5-42d7-adc0-f898636a047b]     10: 
info
[827e9eb0-3ee5-42d7-adc0-f898636a047b]     11:   <body class="prose mx-auto">
info
[827e9eb0-3ee5-42d7-adc0-f898636a047b]   
info
[827e9eb0-3ee5-42d7-adc0-f898636a047b] app/views/layouts/application.html.erb:8:in '_app_views_layouts_application_html_erb___4412628334483315181_9600'
info
==> Your service is live 🎉
info
I, [2025-01-05T18:31:36.925255 #128]  INFO -- : [2b98022a-3edb-472d-9344-0fd29a0c1b79] Started GET "/" for 172.68.174.94 at 2025-01-05 18:31:36 +0000
info
I, [2025-01-05T18:31:36.926286 #128]  INFO -- : [2b98022a-3edb-472d-9344-0fd29a0c1b79] Processing by ExpensesController#index as HTML
info
I, [2025-01-05T18:31:36.928432 #128]  INFO -- : [2b98022a-3edb-472d-9344-0fd29a0c1b79]   Rendered expenses/index.html.erb within layouts/application (Duration: 0.6ms | Allocations: 68)
info
I, [2025-01-05T18:31:36.930400 #128]  INFO -- : [2b98022a-3edb-472d-9344-0fd29a0c1b79]   Rendered layout layouts/application.html.erb (Duration: 2.6ms | Allocations: 545)
info
I, [2025-01-05T18:31:36.930561 #128]  INFO -- : [2b98022a-3edb-472d-9344-0fd29a0c1b79] Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.1ms | Allocations: 729)```
Reply

I should have clarified, specifically the deployment logs. It should show tailwindcss compiling the file at some point.

With tailwindcss-rails v3 and tailwindcss-ruby v4, I see this when it runs assets:precompile

≈ tailwindcss v4.0.0-beta.8

Done in 150ms

One culprit here might be that tailwindcss-rails v3 now depends upon tailwindcss-ruby which lets you use multiple different versions of TailwindCSS with the rails integration. It will default to the latest version for tailwindcss-rails v3, but tailwindcss-rails v2 does not use tailwindcss-ruby and will specifically use TailwindCSS v3.

Pretty confusing, but that's likely where the issue stems from.

Reply

Deciphering these logs is still pretty new to me but this may help:

Log data from successful build using tailwind v2.0:

==> Cloning from https://github.com/aburg15/expense-tracker-test
==> Checking out commit a79ce4931535febfb78710613b06ab2bdf0537bf in branch main
==> Downloading cache...
==> Transferred 114MB in 8s. Extraction took 2s.
==> Using Ruby version 3.4.1 via /opt/render/project/src/Gemfile.lock
==> Docs on specifying a Ruby version: https://render.com/docs/ruby-version
==> Running build command 'bundle install; bundle exec rake assets:precompile; bundle exec rake assets:clean; bundle exec rails db:migrate; bundle exec rails db:seed'...
Fetching gem metadata from https://rubygems.org/.........
Fetching nokogiri 1.18.1 (x86_64-linux-gnu)
Installing nokogiri 1.18.1 (x86_64-linux-gnu)
Fetching tailwindcss-rails 2.7.9 (x86_64-linux)
Installing tailwindcss-rails 2.7.9 (x86_64-linux)
Bundle complete! 21 Gemfile dependencies, 67 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Bundled gems are installed into `/opt/render/project/.gems`

Log data from failed build using tailwind v3.1

==> Cloning from https://github.com/aburg15/expense-tracker-test
==> Checking out commit c5c3c4e647facf3d5aa8d7b1993085e702b0601c in branch main
==> Downloading cache...
==> Transferred 114MB in 7s. Extraction took 2s.
==> Using Ruby version 3.4.1 via /opt/render/project/src/Gemfile.lock
==> Docs on specifying a Ruby version: https://render.com/docs/ruby-version
==> Running build command 'bundle install; bundle exec rake assets:precompile; bundle exec rake assets:clean; bundle exec rails db:migrate; bundle exec rails db:seed'...
Bundle complete! 21 Gemfile dependencies, 68 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Bundled gems are installed into `/opt/render/project/.gems`
rake aborted!
Tailwindcss::Ruby::ExecutableNotFoundException: Cannot find the tailwindcss executable for x86_64-linux in /opt/render/project/.gems/ruby/3.4.0/gems/tailwindcss-ruby-3.4.17/exe (Tailwindcss::Ruby::ExecutableNotFoundException)
Reply

Ah, that last line there.

Might have to run "bundle lock --add-platform x86_64-linux" in order to get the correct precompiled version of the gem for Linux.

Reply

Should that have been run as a render pipeline build command or as a local command? My gemfile.lock contains that particular platform

PLATFORMS
  ruby
  x86_64-darwin-24
  x86_64-linux
Reply

Hmm, yeah then you've already done that. Strange, I'm not entirely sure.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 88,096+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.