This is a common question in here, but none of the solutions fixed my problem, so here it goes:
I am adding ace.js to my rails4 app, So what I did was
-
In case you are adding the ace directory as an assets , you should place the js files under vendor/assets/ace/javascripts directory (which you should create) .
Normally you don't need config.assets.precompile += %w( index.js ), Sprockets will manage it just fine. If there is just one js file to add from vendors/assets/ace directory , you don't need an index.js there . The index.js would be proper if you have a lot of subdirectories and files under vendor/assets/ace/javascripts/your_vendor_js_library . One last touch : you don't need <%= javascript_include_tag "ace" %> , it duplicates <%= javascript_include_tag "application" %>'s content.
It is solved by adding :
config.assets.precompile += %w( index.js )
to config/application.rb. (not config/environments/production.rb)
Tested in Rails 4.0 beta1.