Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 819
Lucia Hill-Rains Avatar asked Mar 10 '16 16:03

Lucia Hill-Rains


2 Answers

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
like image 63
TerryS Avatar answered Oct 05 '22 22:10

TerryS


For development environment, just remove tmp/cache/assets/ path

$ rm -rf tmp/cache/assets/

like image 38
lucianosousa Avatar answered Oct 05 '22 23:10

lucianosousa