ruby-on-railsruby-on-rails-3jammit

Jammit::MissingConfiguration - precache_all': A --base-url option is required in order to generate MHTML


Has anyone seen this when trying to use jammit?

$ heroku jammit:deploy
===== Compiling assets.../Library/Ruby/Gems/1.8/gems/jammit-0.6.3/lib/jammit/packager.rb:47:in `precache_all': A --base-url option is required in order to generate MHTML. (Jammit::MissingConfiguration)
    from /Library/Ruby/Gems/1.8/gems/jammit-0.6.3/lib/jammit/packager.rb:42:in `each'
    from /Library/Ruby/Gems/1.8/gems/jammit-0.6.3/lib/jammit/packager.rb:42:in `precache_all'
    from /Library/Ruby/Gems/1.8/gems/jammit-0.6.3/lib/jammit.rb:132:in `package!'
    from /Library/Ruby/Gems/1.8/gems/jammit-0.6.3/bin/../lib/jammit/command_line.rb:29:in `initialize'
    from /Library/Ruby/Gems/1.8/gems/jammit-0.6.3/bin/jammit:5:in `new'
    from /Library/Ruby/Gems/1.8/gems/jammit-0.6.3/bin/jammit:5
    from /usr/bin/jammit:19:in `load'
    from /usr/bin/jammit:19
[FAIL]

Ideas? Thanks


Solution

  • I had the same issue with my rake task.

    namespace :assets do
      task :package do
        Jammit.package!
      end
    end
    

    It happens when you use "embed_assets" option. To fix it I added :base_url parameter for .package! call and now it works as before.

    namespace :assets do
      task :package do
        Jammit.package! :base_url => "http://mysite.org/"
      end
    end