documentcloud / jammit

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

Jammit crash on Heroku (Using Ruby on Rails 3.0.0) #63

Closed otobrglez closed 14 years ago

otobrglez commented 14 years ago

Hi all!

I want to use Jammit on Heroku cloud... Localy it works great and its perfect!

This is error log from heroku...

zbook:itatu otobrglez$ heroku logs
DEPRECATION WARNING: RAILS_DEFAULT_LOGGER is deprecated. Please use ::Rails.logger. (called from require at /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64)
/home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/railties-3.0.0/lib/rails/deprecation.rb:33:in `method_missing': private method `warn' called for nil:Rails::DeprecatedConstant (NoMethodError)
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:173:in `warn'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:161:in `disable_compression'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:151:in `check_java_version'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:81:in `load_configuration'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit/dependencies.rb:15
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:187
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `each'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `require'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `each'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `require'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler.rb:112:in `require'
        from /disk1/home/slugs/273882_5eea37c_5577/mnt/config/application.rb:7
        from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /disk1/home/slugs/273882_5eea37c_5577/mnt/config/environment.rb:2
        from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from config.ru:3
        from /home/heroku_rack/heroku.ru:25
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:63:in `new'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:63:in `map'
        from /home/heroku_rack/heroku.ru:20
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
        from /home/heroku_rack/heroku.ru:13:in `new'
        from /home/heroku_rack/heroku.ru:13
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
        from /home/heroku_rack/heroku.ru:1:in `new'
        from /home/heroku_rack/heroku.ru:1

==> dyno-2054183.log (crash) <==
DEPRECATION WARNING: RAILS_DEFAULT_LOGGER is deprecated. Please use ::Rails.logger. (called from require at /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64)
/home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/railties-3.0.0/lib/rails/deprecation.rb:33:in `method_missing': private method `warn' called for nil:Rails::DeprecatedConstant (NoMethodError)
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:173:in `warn'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:161:in `disable_compression'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:151:in `check_java_version'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:81:in `load_configuration'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit/dependencies.rb:15
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:187
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `each'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `require'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `each'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `require'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler.rb:112:in `require'
        from /disk1/home/slugs/273882_5eea37c_5577/mnt/config/application.rb:7
        from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /disk1/home/slugs/273882_5eea37c_5577/mnt/config/environment.rb:2
        from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from config.ru:3
        from /home/heroku_rack/heroku.ru:25
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:63:in `new'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:63:in `map'
        from /home/heroku_rack/heroku.ru:20
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
        from /home/heroku_rack/heroku.ru:13:in `new'
        from /home/heroku_rack/heroku.ru:13
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
        from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
        from /home/heroku_rack/heroku.ru:1:in `new'
        from /home/heroku_rack/heroku.ru:1

-----> An error happened during the initialization of your app.

       This may be due to a typo, wrong number of arguments, or calling a
       function that doesn't exist.

       Make sure the app is working locally in production mode, by running it
       with RAILS_ENV (for Rails apps) or RACK_ENV (for Sinatra or other rack
       apps) set to production. e.g. RAILS_ENV=production script/server.

       Examine the backtrace above this message to debug.
agibralter commented 14 years ago

A few things...

I thought that Heroku has a read-only file system meaning that you have to pre-package all your production assets in your repo before pushing...

This actual error seems to be something with Jammit's logging, but I also think that it's having problems finding java on Heroku's servers:

from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:173:in `warn'
from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:161:in `disable_compression'
from /home/slugs/273882_5eea37c_5577/mnt/.bundle/gems/ruby/1.8/gems/jammit-0.5.1/lib/jammit.rb:151:in `check_java_version'

It really seems like you'd want to run jammit before commiting/pushing to heroku...

lukebyrne commented 14 years ago

I am seeing the same issue.

ljmcallister commented 14 years ago

I am getting the same deprecation warning as well running a Rails3 app under Ubuntu against REE (1.8.7p253) and Jammit 0.5.1

otobrglez commented 14 years ago

I tried Jammit on Ruby 1.9.2-head with Rails 3.0.0. and i'm also getting same errors... After installing Java / JDK everything worked fine... It seams that it trys to give error that Java is not present on system but it uses wrong(deprecated) system for errors/warnings...

heroku cloud does now have Java... And heroku is read-only... So this two facts restrict usage of jammit. But you can still "prepackage" everything with jammit before deployin to jammit (perhapse using different enviroments)

gosuri commented 14 years ago

this is fixed http://github.com/documentcloud/jammit/issues/closed#issue/60

gosuri commented 14 years ago

Just specify the below in your Gemfile if you are using Bundler

   gem "jammit", :git => "git://github.com/documentcloud/jammit.git"