1
rake assets:precompile
を実行すると、異常なエラーが発生します。私はjruby 1.6.5.1を使用しています。この問題は1台のマシンでのみ発生しますが、他のマシンでは正常に動作します。Rails 3.1のプリコンパイルアセットエラー
[[email protected] someapp]$ rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/x/.rvm/rubies/jruby-1.6.5.1/bin/jruby /home/x/.rvm/gems/jruby-1.6.5.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
partial character in source, but hit end near �\")&& (k=/^[\\s\\xA0]+/,l=/[\\s\\xA0]+$/),h=e(c),c.addEventListener......
..............................
(in /home/x/someapp/cmeng/app/assets/javascripts/application.js)
json/ext/Parser.java:249:in `parse'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/json-1.6.1-java/lib/json/common.rb:148:in `parse'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb:13:in `decode'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/multi_json-1.0.3/lib/multi_json.rb:65:in `decode'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/execjs-1.2.9/lib/execjs/external_runtime.rb:61:in `extract_result'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/execjs-1.2.9/lib/execjs/external_runtime.rb:27:in `exec'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/execjs-1.2.9/lib/execjs/external_runtime.rb:40:in `compile_to_tempfile'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/execjs-1.2.9/lib/execjs/external_runtime.rb:26:in `exec'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/uglifier-1.0.4/lib/uglifier.rb:95:in `compile'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/actionpack-3.1.1/lib/sprockets/compressors.rb:18:in `compress'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/processing.rb:265:in `js_compressor='
org/jruby/RubyProc.java:270:in `call'
org/jruby/RubyProc.java:220:in `call'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/processor.rb:29:in `evaluate'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/context.rb:175:in `evaluate'
org/jruby/RubyArray.java:1612:in `each'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/context.rb:172:in `evaluate'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:242:in `build_source'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/caching.rb:30:in `cache_hash'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:235:in `build_source'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:71:in `digest'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/asset.rb:95:in `digest_path'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/actionpack-3.1.1/lib/sprockets/static_compiler.rb:58:in `path_for'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/actionpack- 3.1.1/lib/sprockets/static_compiler.rb:35:in `write_asset'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/actionpack-3.1.1/lib/sprockets/static_compiler.rb:21:in `compile'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/base.rb:151:in `each_logical_path'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/base.rb:139:in `each_file'
org/jruby/RubyArray.java:1612:in `each'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/base.rb:129:in `each_entry'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/base.rb:137:in `each_file'
org/jruby/RubyArray.java:1612:in `each'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/base.rb:136:in `each_file'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/sprockets-2.0.3/lib/sprockets/base.rb:149:in `each_logical_path'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/actionpack-3.1.1/lib/sprockets/static_compiler.rb:18:in `compile'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/actionpack-3.1.1/lib/sprockets/assets.rake:52:in `internal_precompile'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/actionpack-3.1.1/lib/sprockets/assets.rake:66:in `(root)'
org/jruby/RubyProc.java:270:in `call'
org/jruby/RubyProc.java:220:in `call'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
org/jruby/RubyArray.java:1612:in `each'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/home/x/.rvm/rubies/jruby-1.6.5.1/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/actionpack-3.1.1/lib/sprockets/assets.rake:56:in `(root)'
org/jruby/RubyProc.java:270:in `call'
org/jruby/RubyProc.java:220:in `call'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
org/jruby/RubyArray.java:1612:in `each'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/home/x/.rvm/rubies/jruby-1.6.5.1/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
org/jruby/RubyArray.java:1612:in `each'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/x/.rvm/gems/jruby-1.6.5.1/gems/rake-0.9.2.2/bin/rake:33:in `(root)'
org/jruby/RubyKernel.java:1063:in `load'
/home/x/.rvm/gems/jruby-1.6.5.1/bin/rake:19:in `(root)'
私はjQueryのapp/assets/javascripts/application.js
に(jQueryとjquery_ujs)を必要と削除すると、プリコンパイルタスクが成功します。
私はjqueryのソースファイルにエラーをトレースしました:
// IE doesn't match non-breaking spaces with \s
if (rnotwhite.test("\xA0")) {
trimLeft = /^[\s\xA0]+/;
trimRight = /[\s\xA0]+$/;
}
は\ XA0文字は、このエラーの原因となっていませんか?それとも別のことですか?
ありがとうございました。
問題のコードのブロックをコメントアウトするだけで回避できます原因は何かを知ることは良いことです。 – Garrett
jQueryの同じ行にこのエラーがあります。私の舞台環境に、同じ資産、同じバージョンのjRuby、それに他のすべて(少なくとも、それがあるはずです)を使ってステージング環境にデプロイすると、この問題は発生しません。 ! –
この問題は、/ myステージング/プロダクション・サーバーで実行されているJavaの設定に起因すると思われます.JRubyの同じバージョンのOS Xでプリコンパイルを実行すると問題はありません。 –