juby & less 文件中的资产预编译得到以下错误消息

Posted

技术标签:

【中文标题】juby & less 文件中的资产预编译得到以下错误消息【英文标题】:Asset precompile in juby & less files Getting below error message 【发布时间】:2014-10-31 12:55:11 【问题描述】:
rake aborted!
Java::JavaLang::NullPointerException: 
  (in /home/sivamanikandan/projects/code/current/empwiz/app/assets/stylesheets/components/common/forms/elements/bootstrap-datepicker/assets/custom/less/bootstrap-datepicker.less)
org.jruby.java.proxies.ArrayJavaProxy.to_a(org/jruby/java/proxies/ArrayJavaProxy.java:145)
RUBY.method_missing(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/therubyrhino-2.0.4/lib/rhino/rhino_ext.rb:115)
org.mozilla.javascript.optimizer.OptRuntime.callName(org/mozilla/javascript/optimizer/OptRuntime.java:63)
org.mozilla.javascript.gen._home_sivamanikandan__rvm_gems_jruby_1_7_13_empwiz_gems_less_2_5_1_lib_less_js_lib_less_parser_js_2._c_anonymous_31(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/less-2.5.1/lib/less/js/lib/less/parser.js:669)
org.mozilla.javascript.gen._home_sivamanikandan__rvm_gems_jruby_1_7_13_empwiz_gems_less_2_5_1_lib_less_js_lib_less_parser_js_2._c_anonymous_31(org/mozilla/javascript/gen//home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/less-2.5.1/lib/less/js/lib/less/parser.js:669)
org.mozilla.javascript.optimizer.OptRuntime.call1(org/mozilla/javascript/optimizer/OptRuntime.java:32)
org.mozilla.javascript.gen._home_sivamanikandan__rvm_gems_jruby_1_7_13_empwiz_gems_less_2_5_1_lib_less_js_lib_less_import_visitor_js_36._c_anonymous_4(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/less-2.5.1/lib/less/js/lib/less/import-visitor.js:25)
org.mozilla.javascript.gen._home_sivamanikandan__rvm_gems_jruby_1_7_13_empwiz_gems_less_2_5_1_lib_less_js_lib_less_import_visitor_js_36._c_anonymous_4(org/mozilla/javascript/gen//home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/less-2.5.1/lib/less/js/lib/less/import-visitor.js:25)
org.mozilla.javascript.optimizer.OptRuntime.call1(org/mozilla/javascript/optimizer/OptRuntime.java:32)
org.mozilla.javascript.gen._home_sivamanikandan__rvm_gems_jruby_1_7_13_empwiz_gems_less_2_5_1_lib_less_js_lib_less_parser_js_2._c_anonymous_24(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/less-2.5.1/lib/less/js/lib/less/parser.js:674)
org.mozilla.javascript.gen._home_sivamanikandan__rvm_gems_jruby_1_7_13_empwiz_gems_less_2_5_1_lib_less_js_lib_less_parser_js_2._c_anonymous_24(org/mozilla/javascript/gen//home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/less-2.5.1/lib/less/js/lib/less/parser.js:674)
org.mozilla.javascript.ContextFactory.doTopCall(org/mozilla/javascript/ContextFactory.java:394)
org.mozilla.javascript.ScriptRuntime.doTopCall(org/mozilla/javascript/ScriptRuntime.java:3091)
java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606)
RUBY.parse(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/less-2.5.1/lib/less/parser.rb:64)
RUBY.do_open(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/therubyrhino-2.0.4/lib/rhino/context.rb:267)
RUBY.open(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/therubyrhino-2.0.4/lib/rhino/context.rb:252)
RUBY.exec(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/less-2.5.1/lib/less/java_script/rhino_context.rb:37)
RUBY.exec(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/less-2.5.1/lib/less/java_script.rb:26)
RUBY.parse(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/less-2.5.1/lib/less/parser.rb:63)
RUBY.evaluate(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/less-rails-2.5.0/lib/less/rails/template_handlers.rb:18)
RUBY.render(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/tilt-1.4.1/lib/tilt/template.rb:103)
RUBY.evaluate(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/context.rb:197)
RUBY.evaluate(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/context.rb:194)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.initialize(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:12)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:374)
RUBY.circular_call_protection(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:395)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:373)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:94)
RUBY.cache_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:93)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:287)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:61)
RUBY.resolve_dependencies(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:111)
RUBY.resolve_dependencies(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:105)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.build_required_assets(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:97)
RUBY.initialize(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:16)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:374)
RUBY.circular_call_protection(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:395)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:373)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:94)
RUBY.cache_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:93)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:287)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:61)
RUBY.initialize(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/bundled_asset.rb:16)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:377)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:94)
RUBY.cache_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:93)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:287)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:61)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:211)
RUBY.benchmark(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:257)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:210)
RUBY.compile(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:119)
RUBY.compile(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.define(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-rails-2.1.3/lib/sprockets/rails/task.rb:61)
RUBY.with_logger(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-2.11.0/lib/rake/sprocketstask.rb:146)
RUBY.define(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/sprockets-rails-2.1.3/lib/sprockets/rails/task.rb:60)
RUBY.execute(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/task.rb:240)
org.jruby.RubyProc.call(org/jruby/RubyProc.java:271)
RUBY.execute(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/task.rb:235)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.invoke_with_call_chain(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/task.rb:179)
RUBY.mon_synchronize(/home/sivamanikandan/.rvm/rubies/jruby-1.7.13/lib/ruby/1.9/monitor.rb:211)
RUBY.invoke_with_call_chain(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/task.rb:172)
RUBY.invoke(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/task.rb:165)
RUBY.before(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/bower-rails-0.8.3/lib/tasks/helpers/before_hook.rb:16)
RUBY.execute(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/task.rb:240)
org.jruby.RubyProc.call(org/jruby/RubyProc.java:271)
RUBY.execute(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/task.rb:235)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.invoke_with_call_chain(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/task.rb:179)
RUBY.mon_synchronize(/home/sivamanikandan/.rvm/rubies/jruby-1.7.13/lib/ruby/1.9/monitor.rb:211)
RUBY.invoke_with_call_chain(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/task.rb:172)
RUBY.invoke(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/task.rb:165)
RUBY.invoke_task(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/application.rb:150)
RUBY.top_level(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/application.rb:106)
RUBY.top_level(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/application.rb:106)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.run_with_threads(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/application.rb:115)
RUBY.top_level(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/application.rb:100)
RUBY.run(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/application.rb:78)
RUBY.standard_exception_handling(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/application.rb:176)
RUBY.run(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/gems/rake-10.3.2/lib/rake/application.rb:75)
org.jruby.RubyKernel.load(org/jruby/RubyKernel.java:1081)
org.jruby.RubyKernel.eval(org/jruby/RubyKernel.java:1101)
RUBY.(root)(/home/sivamanikandan/.rvm/gems/jruby-1.7.13@empwiz/bin/jruby_executable_hooks:15)
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

【问题讨论】:

你可以在第三行之后删掉这个错误信息,以免吓到人:)(这是它有意义的部分结束的地方)。对编译的内容和方式进行更多描述通常也是一个好主意。 其实还有更有意义的部分...请不要剪掉痕迹:) 【参考方案1】:

这似乎是 JRuby 的 java 集成中的一个错误...请尝试更新到 JRuby 1.7.16

【讨论】:

以上是关于juby & less 文件中的资产预编译得到以下错误消息的主要内容,如果未能解决你的问题,请参考以下文章

资产预编译 Capistrano 3.4

less预编译语言使用总结

资产预编译期间未找到文件错误

Rails 预编译供应商/资产

未使用 Rails 测试环境中的预编译资产

预编译heroku后生产中缺少Rails资产