Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

829
Views
Rails 7 css assets are not working in production, need help understanding how the asset pipeline works without webpacker

Trying out rails 7, with tailwind and postcss.

I have a few stylesheets in assets/stylesheets, which I import through a file called imports.css in the same folder.

//imports.css
@import stylesheet1.css;
@import stylesheet2.css;

I then import that file in application.html.erb with the following:

//application.html.erb
<%= stylesheet_link_tag "application", "imports", "data-turbo-track": "reload" %>

On development everything works fine as intended, meshes well with tailwind. Importing works fine due to postcss. However on production (nginx, puma) it tries to pull in those files and fails. For every stylesheet I have, i see in the browser console:

GET https://mywebsite.com/assets/style/stylesheet1.css net::ERR_ABORTED 404 (Not Found)

I am trying to shift my brain over from webpacker in rails 6, not sure what I need to do here... some thoughts:

  1. Do i need to set it up so that the stylesheets get copied over to the public/assets folder or something? Is there a setting to do that in production.rb? (I feel like rails by default should be already doing this)

  2. Do I need to be manually precompiling these assets on deployment?

Help would be appreciated. Thanks!

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Do I need to be manually precompiling these assets on deployment?

Yes. Since you're not using a Node workflow now, instead relying on Sprockets and assets directly, you need the precompile step in Production.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!