I have a folder called components in my app/assets folder in my Rails app. I am trying to require a js file in a subdirectory of that directory from my application.coffee file.
#= require holderjs/holder
This works in my development environment. But when I deploy to Heroku, it fails with the following error:
Running: rake assets:precompile
Updating mtimes for current assets...
rake aborted!
couldn't find file 'holderjs/holder'
(in /tmp/build_s0zusz8pduh8/app/assets/javascripts/application.coffee:11)
I checked to make sure the components folder is in the assets path of Sprockets on Heroku, and it definitely is. So I can’t understand why Heroku cannot find this file. Any help would be appreciated.
I discovered that since the folder in the components directory were forked from a git repo, there was a problem for Heroku to track them. I had to remove the .git folder in these directories and push again, and this time it worked.