title: Rails 3.1 production assets : big files are cut into pieces
body: <p>Since I use Rails 3.1 and the assets pipeline I have a big problem when in production mode.</p>
  
  <p>When I did a bundle exec rake assets:precompile, I had errors like </p>
  
  <blockquote>
    <p>'myjsfile.js' has a invalid UTF-8 byte sequence</p>
  </blockquote>
  
  <p>in particular with tiny_mce plugin js files.</p>
  
  <p>So I gave up, as everything was working ok in developpment on my mac, and I wrote this line in the production.rb file: <code>config.assets.compile = true</code></p>
  
  <p>The JS files are therefore generated without errors.</p>
  
  <p>On the other hand, there is a big problem with long files, like jquery.js</p>
  
  <p>Regularly, Rails generates only half of the jQuery file, and the only manner I found to fix temporarily the problem is to go on the js file's URL (<code>http://myapp.com/assets/jquery.js</code>) and refresh the page many times, and after a while the jquery file is entire again.
  Then a few days later the problem is back and I've got to do this again.</p>
  
  <p>In fact, it's as if during the compilation of big files, the process stopped in the middle  and that the server sent the file half compiled.</p>
  
  <p>Have some of you had this problem? Any idea from where it could come?</p>
  
  <p>I use nginx and passenger on an Ubuntu server for production. I never encounter this problem on my Mac.</p>
  
  <p>In advance, thank's for your help !</p>