cannot load such file -- coffee_script

Try

rake tmp:cache:clear

or

try adding "gem 'coffee-rails', '~> 4.1.0'" to the Gemfile and running bundle:install.

in rails > 5.2

we need to use rake rails tmp:cache:clear


It may be the cache. Try this: rake tmp:cache:clear and restart your server.


Clear Cache

Like the other answers say:

rake tmp:cache:clear

Do you have any coffee script files?

Likely, look in your assets/javascripts file: there may be some coffee script files in there. If you don't need them, then you can get can simply delete. Now try again and it should work.

If you have coffee script files that you want to keep:

Then add the following to your gemfile and run bundle install

gem 'coffee-rails', '~> 5.0.0'

It should now work.


Having the same issue, none of the solutions above worked for me.

Using rails 5.2.2, I added gem 'coffee-rails', '~> 5.0.0

Then bundle:install and rails tmp:cache:clear

Finally, I've restarted the server and all worked fine.

Hope this help.