Upgrading Ruby - asset pipeline misconfigured

69 views Asked by At

I'm in the process of upgrading Ruby versions for my company, going from 2.7.6 to 3.2.2. Our app uses Rails 6.1.3 and webpacker 6.0.0. I know the webpacker gem is deprecated and we're supposed to use importmaps/jsbundling-rails but I'm saving that work for when I upgrade Rails. I'm sure something is misconfigured somewhere but I'm not quite sure what that is.

Here's the contents of my app/assets/config/manifest.js file:

//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
//= link_tree ../builds

Here's the output when I try to run specs:

     Failure/Error: <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbo-track': 'reload' %>

     ActionView::Template::Error:
       Webpacker can't find application.css in /Users/.../public/packs-test/manifest.json. Possible causes:
       1. You want to set webpacker.yml value of compile to true for your environment
          unless you are using the `webpack -w` or the webpack-dev-server.
       2. webpack has not yet re-run to reflect updates.
       3. You have misconfigured Webpacker's config/webpacker.yml file.
       4. Your webpack configuration is not creating a manifest.
       Your manifest contains:
       {
         "application.js": "/packs-test/js/application-5019ada8c79f4945bc85.js",
         "application.js.map": "/packs-test/js/application-5019ada8c79f4945bc85.js.map",
         "entrypoints": {
           "application": {
             "js": [
               "/packs-test/js/application-5019ada8c79f4945bc85.js"
             ],
             "js.map": [
               "/packs-test/js/application-5019ada8c79f4945bc85.js.map"
             ]
           }
         },
         "vendors~actioncable.js": "/packs-test/js/vendors~actioncable-111339b91a6898730a91.chunk.js",
         "vendors~actioncable.js.map": "/packs-test/js/vendors~actioncable-111339b91a6898730a91.chunk.js.map"
       }

And here's the output when I run bundle exec rails assets:precompile:

Sprockets::DoubleLinkError: Multiple files with the same output path cannot be linked ("tailwind.css")
In "/Users/.../app/assets/config/manifest.js" these files were linked:
  - /Users/.../app/assets/stylesheets/tailwind.css
  - /Users/.../app/assets/builds/tailwind.css

Does anyone have any ideas what might be the issue?

0

There are 0 answers