Topic: Precompile failing somewhere in execjs...

I've upgraded an app from Rails 3.0 to 3.1.  I've enabled the asset pipeline as prescribed in the guides.  Everything works fine in development mode, but when I try to precompile or deploy via capistrano, I get this:

** Invoke assets:precompile (first_time)
** Execute assets:precompile
** Invoke environment (first_time)
** Execute environment
mkdir -p /Users/sgerstacker/Development/asterisk-mets-bridge/public/assets/16
mkdir -p /Users/sgerstacker/Development/asterisk-mets-bridge/public/assets/16
mkdir -p /Users/sgerstacker/Development/asterisk-mets-bridge/public/assets/16
mkdir -p /Users/sgerstacker/Development/asterisk-mets-bridge/public/assets/16
mkdir -p /Users/sgerstacker/Development/asterisk-mets-bridge/public/assets/16
mkdir -p /Users/sgerstacker/Development/asterisk-mets-bridge/public/assets/16
mkdir -p /Users/sgerstacker/Development/asterisk-mets-bridge/public/assets/16
mkdir -p /Users/sgerstacker/Development/asterisk-mets-bridge/public/assets
rake aborted!
wrong number of arguments (1 for 0)
  (in /Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/jquery-rails-1.0.13/vendor/assets/javascripts/jquery-ui.min.js)
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/execjs-1.2.4/lib/execjs/external_runtime.rb:7:in `encode'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/execjs-1.2.4/lib/execjs/external_runtime.rb:7:in `initialize'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/execjs-1.2.4/lib/execjs/external_runtime.rb:108:in `new'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/execjs-1.2.4/lib/execjs/external_runtime.rb:108:in `compile'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/execjs-1.2.4/lib/execjs/module.rb:27:in `compile'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/uglifier-1.0.3/lib/uglifier.rb:49:in `initialize'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/actionpack-3.1.0/lib/sprockets/railtie.rb:87:in `new'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/actionpack-3.1.0/lib/sprockets/railtie.rb:87:in `expand_js_compressor'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `send'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/actionpack-3.1.0/lib/sprockets/railtie.rb:62
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/actionpack-3.1.0/lib/sprockets/compressors.rb:14:in `call'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/actionpack-3.1.0/lib/sprockets/compressors.rb:14:in `compressor'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/actionpack-3.1.0/lib/sprockets/compressors.rb:18:in `compress'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/processing.rb:265:in `js_compressor='
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/processor.rb:29:in `call'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/processor.rb:29:in `evaluate'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/context.rb:175:in `evaluate'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/context.rb:172:in `each'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/context.rb:172:in `evaluate'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/bundled_asset.rb:242:in `build_source'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/caching.rb:26:in `cache_hash'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/bundled_asset.rb:235:in `build_source'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/bundled_asset.rb:71:in `digest'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/asset.rb:95:in `digest_path'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/actionpack-3.1.0/lib/sprockets/assets.rake:35
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/base.rb:128:in `each_logical_path'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/base.rb:117:in `each_file'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/base.rb:116:in `each'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/base.rb:116:in `each_file'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/base.rb:115:in `each'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/base.rb:115:in `each_file'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/sprockets-2.0.0/lib/sprockets/base.rb:126:in `each_logical_path'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/actionpack-3.1.0/lib/sprockets/assets.rake:27
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/actionpack-3.1.0/lib/sprockets/assets.rake:26:in `each'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/actionpack-3.1.0/lib/sprockets/assets.rake:26
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/bin/rake:19:in `load'
/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/bin/rake:19
Tasks: TOP => assets:precompile

I've created a new Rails 3.1 app for testing and it seems to work fine.  I've checked all of the config files and even the config in the Application object in irb.  Everything comes out identical.  Any ideas on this one?

Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.1.0'

gem 'builder'
gem 'ejs'
gem 'exception_notification', :require => 'exception_notifier'
gem 'jquery-rails'
gem 'json'
gem 'mysql2'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'coffee-rails', '~> 3.1.0'
  gem 'sass-rails', '~> 3.1.0'
  gem 'uglifier'
end

group :development, :test do
  gem 'ci_reporter'
  gem 'factory_girl_rails'
  gem 'rspec-rails'
  gem 'shoulda'
  gem 'webrat'
end

application.js:

// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require_tree .

$(document).ready(function() {
  $('.play').musicDialog();
});

Re: Precompile failing somewhere in execjs...

Here is the dump of the two config hashes.  First is the test app, second is the production app.

#<OrderedHash {
  :cache_store=>[:file_store, "/Users/sgerstacker/Development/temp/tmp/cache/assets/"], 
  :compile=>true, 
  :compress=>false, 
  :css_compressor=>nil, 
  :debug=>true, 
  :digest=>false, 
  :digests=>{"jquery.min.js"=>"jquery-8a50feed8d29566738ad005e19fe1c2d.min.js", "jquery-ui.min.js"=>"jquery-ui-7e33882a28fc84ad0e0e47e46cbf901c.min.js", "rails.png"=>"rails-bd9ad5a560b5a3a7be0808c5cd76a798.png", "application.css"=>"application-ccb8034635849c44627859332fda6a01.css", "application.js"=>"application-48f8c652bc0b152ec609cf2202317868.js"}, 
  :enabled=>true,
  :js_compressor=>nil, 
  :manifest=>"/Users/sgerstacker/Development/temp/public/assets",
  :paths=>["/Users/sgerstacker/Development/temp/app/assets/images", "/Users/sgerstacker/Development/temp/app/assets/javascripts", "/Users/sgerstacker/Development/temp/app/assets/stylesheets", "/Users/sgerstacker/Development/temp/vendor/assets/stylesheets", "/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/jquery-rails-1.0.13/vendor/assets/javascripts"], 
  :precompile=>[/\w+\.(?!js|css).+/, /application.(css|js)$/], 
  :prefix=>"/assets", 
  :version=>"1.0"
}>

#<OrderedHash {
  :cache_store=>[:file_store, "/Users/sgerstacker/Development/asterisk-mets-bridge/tmp/cache/assets/"], 
  :compile=>true, 
  :compress=>false, 
  :css_compressor=>nil, 
  :debug=>true, 
  :digest=>false, 
  :enabled=>true, 
  :js_compressor=>nil, 
  :manifest=>"/Users/sgerstacker/Development/asterisk-mets-bridge/public/assets", 
  :paths=>["/Users/sgerstacker/Development/asterisk-mets-bridge/app/assets/images", "/Users/sgerstacker/Development/asterisk-mets-bridge/app/assets/javascripts", "/Users/sgerstacker/Development/asterisk-mets-bridge/app/assets/stylesheets", "/Users/sgerstacker/Development/asterisk-mets-bridge/vendor/assets/stylesheets", "/Users/sgerstacker/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/jquery-rails-1.0.13/vendor/assets/javascripts"], 
  :precompile=>[/\w+\.(?!js|css).+/, /application.(css|js)$/], 
  :prefix=>"/assets", 
  :version=>"1.0"
}>

Re: Precompile failing somewhere in execjs...

Upgraded to jquery-rails 1.0.14.  Same problem.

Re: Precompile failing somewhere in execjs...

Okay, I'm an idiot...

I monkey patched the String class with an encode function a long time back, and for no real reason, which caused the break.