I've been sitting for months on this, every time I precompiled the assets something wrong went into the assets public/folder so something wasn't working. I needed to copy old assets into the public/assets folder to get it working. For a long time I tried to figure out in which order the imports have to be and which require statements are destroying already working things.
My solution after all this time is, I need to import these:
//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require_tree .
And don't ever put a script, e.g. a start-carousel-script into the application.js file. If I place it into the application.html.erb file like this:
<%= javascript_include_tag "application" %>
<script type='text/javascript'>
$(document).ready(function() {
$('.carousel').carousel({
interval: 3000
})
});
</script>
Everthing works fine. Notice: it hat to be under the application include_tag otherwhise I can't work.
Notice 2: I've got a googlemaps script as well, but it's only(!) imported in the file where the map lives. It's this script:
<script src="https://maps.googleapis.com/maps/api/js?key=KEY&sensor=false"></script>
I really hope this helps other people save their time. There are some things that aren't that obvious.