How to resolve Sprockets::DoubleLinkError application.css
Asked Answered
S

1

9

I'm experiencing this error while pushing to heroku repo

remote:        rake aborted!
remote:        Sprockets::DoubleLinkError: Multiple files with the same output path cannot be linked ("style.css")
remote:        In "/tmp/build_f430cee0cae4a9543fac20926137c7cc/app/assets/config/manifest.js" these files were linked:
remote:          - /tmp/build_f430cee0cae4a9543fac20926137c7cc/app/assets/stylesheets/style.css
remote:          - /tmp/build_f430cee0cae4a9543fac20926137c7cc/app/assets/stylesheets/style.scss

I have tried these suggestions:

  1. I deleted the .css file and kept the .scss (there are no duplicates AFAIK)
  2. cleared temp directory with heroku run rake tmp:clear
  3. reset repo with heroku repo:reset -a <app name>
  4. heroku repo:purge_cache -a <app name>

But I still keep getting the error when I push to the Heroku remote

Stigma answered 27/6, 2020 at 17:11 Comment(2)
Did you check in your changes into the repo too after deleting the .scss file?Strand
Try to clean the precompiled assets on Heroku with rake assets:clobberStrand
M
7

For me, this simply occurred because I had two style sheets where I should have had only one. In my case, I had

myapp/app/assets/stylesheets.application.css

AND

myapp/app/assets/stylesheets.application.css.scss

where I should have had just one of those

I removed application.css and the problem went away

Magnifico answered 11/9, 2020 at 9:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.