Skip to content

Instantly share code, notes, and snippets.

@mikejarema
Created September 7, 2016 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikejarema/7617539662308a8fbcfcd76cec64649e to your computer and use it in GitHub Desktop.
Save mikejarema/7617539662308a8fbcfcd76cec64649e to your computer and use it in GitHub Desktop.
Isolated test case to demonstrate Hashie failure due to the nature of "active_support/..." require statement
require 'hashie'
# Include an ActiveSupport extension *other than* ActiveSupport::HashWithIndifferentAccess
require 'active_support/core_ext/string/inflections'
hash = {}.extend(Hashie::Extensions::DeepFind).deep_find("something")
# => NameError: uninitialized constant ActiveSupport::HashWithIndifferentAccess
@mikejarema
Copy link
Author

Result for Hashie v3.4.4

/usr/local/var/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/hashie-3.4.4/lib/hashie/extensions/deep_locate.rb:67:in `_construct_key_comparator': uninitialized constant ActiveSupport::HashWithIndifferentAccess (NameError)
    from /usr/local/var/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/hashie-3.4.4/lib/hashie/extensions/deep_locate.rb:20:in `deep_locate'
    from /usr/local/var/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/hashie-3.4.4/lib/hashie/extensions/deep_find.rb:52:in `_deep_find_all'
    from /usr/local/var/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/hashie-3.4.4/lib/hashie/extensions/deep_find.rb:48:in `_deep_find'
    from /usr/local/var/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/hashie-3.4.4/lib/hashie/extensions/deep_find.rb:19:in `deep_find'
    from ../hashie_deep_find_failure.rb:6:in `<main>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment