Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

833
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda