Search code examples
ruby-on-railsgitamazon-elastic-beanstalkgmaps4railsmarkerclusterer

Ruby on rails. Deployment fails because markerclusterer not found


I am trying to deploy to elasticbeanstalk but deployment fails with Sprockets::FileNotFound: couldn't find file 'markerclustererplus/src/markerclusterer_packed.js' with type 'application/javascript'

Recently Google changed it's sources and I followed this guide to re-enable the markerclusterer javascript.

Everything works correctly in development but fails when deploying. If I remove the lines

#= require markerclustererplus/src/markerclusterer_packed.js from application.js.erb then the app deploys but obviously the map doesn't work.

I can see that vendor/assets/google-maps-utility-library-v3/markerclustererplus/src/ markercluster_packed.js DOES exist. I suppose this is why it works in development, but I have no idea why it fails on deployment.

Now, maybe I'm doing something wrong as the very last line of the tutorial git submodule update — init fails for me with the error:

error: pathspec '—' did not match any file(s) known to git.
error: pathspec 'init' did not match any file(s) known to git.

I didn't think much of it as development env works fine, but maybe it has something to do with my problem. This is the first time i've ever dealt with submodules in git so I may well be missing something.

UPDATE: Whilevendor/assets/google-maps-utility-library-v3/markerclustererplus/src/ markercluster_packed.js does exist in dev environment, I have just SSH'd into the beanstalk environment and the path cannot be found. vendor/assets/google-maps-utility-library-v3 exists but vendor/assets/google-maps-utility-library-v3/markerclustererplus does not. I don't know why the clusterer bit isn't being copied.


Solution

  • Ok this is a terrible answer but my problem was that beanstalk wasn't adding my vendor assets to the deployment. I have no idea why, it is not on any ignore list.

    To resolve the issue I moved markerclusterer and images to assets/javascripts -- assets/images respectivly.