jruby / jruby-rack

Rack for JRuby and Java appservers
MIT License
397 stars 137 forks source link

HTTP500 because of empty Rails.application.config.assets.digests after upgrade v1.1.13.1 #149

Closed bsingr closed 10 years ago

bsingr commented 11 years ago

The upgrade from jruby-rack v1.1.10 to v1.1.13.1 breaks our rails app in production.

The app cannot place the asset paths in the HTML when loading a page, because the Rails.application.config.assets.digests returns nil. This finally leads to the AssetNotPrecompiledError.new("#{logical_path} isn't precompiled") from rails_helper.rb:142 (actionpack) and the app responds with HTTP500.

However, using rails console the Rails.application.config.assets.digests correctly returns the hash build from public/assets/manifest.yml.

I don't know much about the internals of jruby-rack, maybe it is a problem with reading or caching the manifest.yml?

Right now we use JRuby 1.6.8 and Rails 3.2.12.

Maybe similar to #136 (?)

kares commented 11 years ago

so your assets are pre-compiled - everything works fine e.g. on an MRI server run in production (locally) or with 1.1.10 but not with 1.1.13.1 I assume you warble your application (and the assets are correctly there) ... would it be possible to reproduce this on a minimal Rails app so we can reproduce ? (maybe it should even reproduce with Trinidad so we do not have to make .war and deploy those) thx

mmc1ntyre commented 10 years ago

I'm having this issue with version 1.1.14 as well. I'm getting net::ERR_CONTENT_LENGTH_MISMATCH errors for my assets. Running jruby 1.7.11 and warbler 1.4.2. Downgrading to jruby-rack 1.1.12 has resolved the issue.

kares commented 10 years ago

thanks, once again if you'd like these resolved please setup a simple Rails app where it can be reproduced, also check if assets/manifest.yml is included correctly in the .war (there's been a Warbler issue)

mmc1ntyre commented 10 years ago

Here is a sample rails project.

https://github.com/mmc1ntyre/bug-demo

There is a war file there that already has the assets precompiled. Run the war file in your choice of Java App Server. I am experiencing the issue in Jetty.

kares commented 10 years ago

this should be fixed with JRuby-Rack 1.1.15 ... please do let us know otherwise, thank you all!