Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve Sprockets::DoubleLinkError application.css

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

like image 448
kev Avatar asked Apr 30 '26 16:04

kev


1 Answers

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

like image 50
stevec Avatar answered May 02 '26 08:05

stevec



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!