0

Rails version: 7.2.2

Ruby: 3.2.0

I'm deploying an almost-blank app to Dokku. I'm including Tailwind and my asset pipeline is nothing but Sprockets with importmap. There's no CI involved, no tests are being run before deployment (a LOT of existing questions about this issue revolved around tests)

When the app is deployed, the usual "We're sorry, but something went wrong." appears. Logs show the actual error:

Sprockets::Rails::Helper::AssetNotFound (The asset "tailwind.css" is not present in the asset pipeline.
 )
     <link rel="icon" href="/icon.png" type="image/png">
     <link rel="icon" href="/icon.svg" type="image/svg+xml">
     <link rel="apple-touch-icon" href="/icon.png">
     <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
     <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
     <%= javascript_importmap_tags %>
   </head>

 app/views/layouts/application.html.erb:16

There's nothing on public/assets. Folder doesn't even exists. Also nothing in app/assets/builds. So I run RAILS_ENV=production rails assets:clean assets:precompile and assets files are generated into public/assets. app/assets/builds is populated with tailwind.css as well.

Go to root again, and the same error view is displayed again. The logs show the same error, as if nothing was generated.

In addition, Rails.configuration.assets.paths shows that at the very least, the builds folder should be picked up for the tailwind css file.

Rails.configuration.assets.paths = ["/myapp/app/assets/builds",
 "/myapp/app/assets/config",
 "/myapp/app/assets/images",
 "/myapp/app/assets/stylesheets",
 "/usr/local/bundle/gems/tailwindcss-rails-3.0.0/app/assets/fonts",
 "/usr/local/bundle/gems/tailwindcss-rails-3.0.0/app/assets/stylesheets",
 "/usr/local/bundle/gems/stimulus-rails-1.3.4/app/assets/javascripts",
 "/usr/local/bundle/gems/turbo-rails-2.0.11/app/assets/javascripts",
 "/usr/local/bundle/gems/activestorage-7.2.2/app/assets/javascripts",
 "/usr/local/bundle/gems/actionview-7.2.2/app/assets/javascripts",
 #<Pathname:/myapp/app/javascript>,
 #<Pathname:/myapp/vendor/javascript>]

Finally, these options are set up in environments/production.rb:

config.assets.css_compressor = nil
config.assets.compile = true

What am I missing?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.