我是一个相对较新的Rails程序员,当我尝试预编译资源(甚至有时运行服务器)时,我得到这个错误:
TypeError: couldn't digest ActiveSupport::StringInquirer /Users/Lucia/jruby/lib/ruby/gems/shared/gems/sprockets-3.5.2/lib/sprockets/digest_utils.rb:83:in `digest' /Users/Lucia/jruby/lib/ruby/gems/shared/gems/sprockets-3.5.2/lib/sprockets/loader.rb:55:in `block in load' /Users/Lucia/jruby/lib/ruby/gems/shared/gems/sprockets-3.5.2/lib/sprockets/loader.rb:312:in `block in fetch_asset_from_dependency_cache' org/jruby/RubyArray.java:1560:in `each' org/jruby/RubyEnumerable.java:1016:in `each_with_index' /Users/Lucia/jruby/lib/ruby/gems/shared/gems/sprockets-3.5.2/lib/sprockets/loader.rb:308:in `fetch_asset_from_dependency_cache' /Users/Lucia/jruby/lib/ruby/gems/shared/gems/sprockets-3.5.2/lib/sprockets/loader.rb:44:in `load'
…
我已经尝试关闭开发中的消化,并尝试使用指定开发的RAILS_ENV标志运行耙子任务,但没有结果.
我已经尝试在google上看这个问题,似乎找不到任何相关的东西.
我正在运行jRuby 9.0.5.0和rails 4.2.5.2.
解决方法
尝试启动这些命令:
RAILS_ENV=test bundle exec rake assets:clean RAILS_ENV=test bundle exec rake tmp:cache:clear RAILS_ENV=test bundle exec rake assets:precompile