Getting this error on precompiling assets: TypeError: couldn't digest ActiveSupport::StringInquirer

Getting this error on precompiling assets: TypeError: couldn't digest ActiveSupport::StringInquirer

我是一个相对较新的 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 标志来执行 rake 任务,但没有结果。

我已尝试在 google 上查看此问题,但似乎找不到任何相关内容。

我是 运行宁 jRuby 9.0.5.0rails 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

对于开发环境,只需删除tmp/cache/assets/路径

$ rm -rf tmp/cache/assets/