Upgrading from rails 5.2
to rails 6.0.1
, I get the following error when loading a page in development mode:
Sprockets::FileNotFound - couldn't find file 'leaders.source.coffee'
Checked in these paths:
app/assets/audios
app/assets/config
app/assets/images
...
My app/javascripts directory does not have any filed called leaders.source.coffee
or any file starting with leaders
. I have searched my code base and I could not find any reference to leaders
.
My manifest file is
#app/assets/config/manifest.js is
//= link_tree ../images
//= link_tree ../audios
//= link application.css
//= link application.js
//= link print.css
How do I fix this?
I am not sure why, but setting debug to false fixed this, i.e.
config.assets.debug = false
If this does not work, or you cannot permanently use this setting, you might like to try @Guillaume Petit's answer below.
Removing the cache folder did the trick for me
rm -rf tmp/cache
I get the same error if I call rails generate controller [controllername]
from the command line, but not if I manually make a controller. I'm guessing there's some sort of version conflict in what's generating the files, and what's running the files. It's not much more work to just manually make the things, so I'm just using that as a workaround.
The solution was to go into app/assets/javascripts/
and delete the coffee file generated there. Our guess is that the boilerplate code we're working off of (we're students) is the source of the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With