documentcloud / jammit

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

Exception when running with ./script/server -d (detached mode) #3

Closed ncdc closed 14 years ago

ncdc commented 14 years ago

This is too strange - if I run ./script/server, everything is great. If I do ./script/server -d, I get the trace below. I even manually added "javascript_compressor: yui" to my assets.yml just in case. Any thoughts? This env is Rails 2.3.4, mongrel 1.1.5.

ActionView::TemplateError (You have a nil object when you didn't expect it! The error occurred while evaluating nil.merge) on line #7 of app/views/layouts/main.html.erb: 4: 5: <%= @page_title %> 6: 7: <%= include_stylesheets :core, :all %> 8: 9: <%= include_javascripts :core %> 10:

jammit (0.2.1) lib/jammit/compressor.rb:44:in `initialize'
jammit (0.2.1) lib/jammit/packager.rb:16:in `new'
jammit (0.2.1) lib/jammit/packager.rb:16:in `initialize'
jammit (0.2.1) lib/jammit.rb:60:in `new'
jammit (0.2.1) lib/jammit.rb:60:in `packager'
jammit (0.2.1) lib/jammit/helper.rb:43:in `individual_stylesheets'
jammit (0.2.1) lib/jammit/helper.rb:66:in `tags_with_options'
jammit (0.2.1) lib/jammit/helper.rb:66:in `map!'
jammit (0.2.1) lib/jammit/helper.rb:66:in `tags_with_options'
jammit (0.2.1) lib/jammit/helper.rb:43:in `individual_stylesheets'
jammit (0.2.1) lib/jammit/helper.rb:18:in `include_stylesheets'
app/views/layouts/main.html.erb:7
app/controllers/opportunities_controller.rb:58:in `index'
documentcloud commented 14 years ago

Hmm. that is strange -- can you log the value of Jammit.javascript_compressor at that point?

ncdc commented 14 years ago

It's empty for some odd reason.

documentcloud commented 14 years ago

Alright -- I've pushed out a 0.2.3 with more robust setting of the compressor. (and tests for a completely crazy assets.yml file). Give that one a try -- and thanks for all the help getting this little library off the ground.

ncdc commented 14 years ago

Unfortunately the stack trace is similar with 0.2.3:

jammit (0.2.3) lib/jammit/compressor.rb:44:in `initialize'
jammit (0.2.3) lib/jammit/packager.rb:16:in `new'
jammit (0.2.3) lib/jammit/packager.rb:16:in `initialize'
jammit (0.2.3) lib/jammit.rb:62:in `new'
jammit (0.2.3) lib/jammit.rb:62:in `packager'
jammit (0.2.3) lib/jammit/helper.rb:43:in `individual_stylesheets'
jammit (0.2.3) lib/jammit/helper.rb:66:in `tags_with_options'
jammit (0.2.3) lib/jammit/helper.rb:66:in `map!'
jammit (0.2.3) lib/jammit/helper.rb:66:in `tags_with_options'
jammit (0.2.3) lib/jammit/helper.rb:43:in `individual_stylesheets'
jammit (0.2.3) lib/jammit/helper.rb:18:in `include_stylesheets'
app/views/layouts/main.html.erb:7
documentcloud commented 14 years ago

Ok. If you'd like to speed this process up a bit, you can reach me on Google Talk / GMail at jeremy -@- ashkenas.com. Otherwise -- what environment are we talking about here? Can you pastie your assets.yml for me?

documentcloud commented 14 years ago

And if you feel like checking out the repo and running "rake test", that would help too.

documentcloud commented 14 years ago

Alright -- we got this resolved offline, and Jammit 0.2.4 is the result of some of the fixes for it. If you're running 0.2.4 and you see any problems with caching empty files, re-open this ticket or start a new one that references this.