I've got a problem with Rails 3.1 assets pipeline. Assets are included twice in development:
<script src="/assets/main_new.js?body=1" type="text/javascript"></script>
<script src="/assets/pagenav.js?body=1" type="text/javascript"></script>
<script src="/assets/tours.controller.js?body=1" type="text/javascript"></script>
<script src="/assets/tours.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>
Rails somehow compiles and includes application.js so all the scripts are included twice - as individual file and in application.js
Everything's fine with precompiled assets in production.
development.rb
config.assets.compress = false
config.assets.debug = true
production.rb
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress both stylesheets and JavaScripts
config.assets.compress = true
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :scss
config.assets.compile = false
config.assets.digest = true
application.rb
config.assets.enabled = true
rake assets:clean
. development might still serve application.js but it shouldn't have all the other js files in it. – firienpublic/assets
. – Nicolas Goy