This is the workaround I used (in my case for the worker-*.js files, but it should work for the modes and themes too):
- create perm_assets/javascripts in /public
- copy the .js files (e.g. worker-json.js) to public/perm_assets/javascripts
- in one of your own .js files, add the following line (inside a document ready block):
ace.config.set("workerPath", "/perm_assets/javascripts");
Rather than (or in addition to) "workerPath", you can specify "modePath" and "themePath".
I was helped by this discussion too: https://github.com/ajaxorg/ace/issues/655