The error:
/Library/Ruby/Gems/1.8/gems/json_pure-1.4.3/lib/json/pure/generator.rb:232:in `__send__': undefined method `except' for #<JSON::Pure::Generator::State:0x102f245b0> (NoMethodError)
The environment: Ruby 1.8.7, DataMapper, dm-types, ActiveSupport, or just
require 'json/pure'
require 'active_support'
(as seen in http://gist.github.com/339528)
My solution:
# workaround for activesupport vs. json_pure vs. Ruby 1.8 glitch
if JSON.const_defined?(:Pure)
class JSON::Pure::Generator::State
include ActiveSupport::CoreExtensions::Hash::Except
end
end
About the Author