documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

Templates in development environment doesn't load (on Rails 3, cold start) #51

Closed mantas closed 14 years ago

mantas commented 14 years ago

I'm using Jammit from master branch with Rails 3 application. I'm using passenger/apache for the server. Whole thing is running on a Mac in development environment.

When I open web page for the first time after rebooting apache (so it's a fresh instance), jammit gives following error:

undefined local variable or method `_router' for Jammit::Controller:Class

When I reload web page after a few seconds, it works just fine.

jashkenas commented 14 years ago

Hopefully this is due to this nasty little issue:

http://github.com/documentcloud/jammit/issues/closed#issue/53

And updating to 0.5.1 will fix it for you. If not, let me know.

mantas commented 14 years ago

I tried to update to 0.5.1, but looks like it still has the same problem. Doesn't work on a cold start, but everything is ok after few moments

jondot commented 14 years ago

yup, same exact thing happens here. i actually had that yesterday and after a day's worth looking through the jammit code i figured no one yet bumped into it.

My scenario is that when i switch to production (on my development machine), i see java running every time i make a request, so everytime there is a pack operation. I think the symptom comes due to that. Because it takes about 30 sec per request in that case. This is the first time i try Jammit, and also am doing it on rails3 beta4. so it might be my fault somehow. Currently I'm aiming at just pre-caching on production and avoiding it all.

I'm also running 0.5.1. Thanks!

jashkenas commented 14 years ago

Are either of you still experiencing this error? Or has it been shaken out with a more recent Rails 3 beta?

mantas commented 14 years ago

Looks like it's fixed by one of the RCs.

jashkenas commented 14 years ago

Fantastic, thanks for keeping me in the loop.