在预编译资产上获得此错误:TypeError:无法消化ActiveSupport :: StringInquirer

Luc*_*ins 14 ruby ruby-on-rails jruby ruby-on-rails-4

我是一个相对较新的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'
Run Code Online (Sandbox Code Playgroud)

...

我已经尝试在开发中关闭摘要,并尝试使用RAILS_ENV指向开发的标志运行rake任务,但没有结果.

我试过在谷歌上看这个问题,似乎找不到任何相关的东西.

我跑jRuby 9.0.5.0rails 4.2.5.2.

Ter*_*ryS 9

尝试启动这些命令:

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
Run Code Online (Sandbox Code Playgroud)


luc*_*usa 7

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

$ rm -rf tmp/cache/assets/