Search code examples
ruby-on-railsrubyruby-on-rails-4jruby

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


I'm a relatively new Rails programmer, and when I try to precompile assets (or even run the server sometimes), I get this error:

    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'

...

I've tried turning off digesting in development, and have tried running the rake task with the RAILS_ENV flag pointing to development, but with no results.

I've tried looking this issue on google, and can't seem to find anything relevant.

I'm running jRuby 9.0.5.0 and rails 4.2.5.2.


Solution

  • Try to kick off these commands:

    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