Hi,

The new ejson module doesn't support older versions of Erlang because the
expected result from the module's on_load fun changed from true to ok.

The attached one-line change (as a git diff) fixes it for me using the
standard Erlang packages on Ubuntu 10.10 and 11.04 but I don't have a newer
version of Erlang installed to test against.

Obviously, with this change applied I'm still using the non-NIF json
implementation but at least the ejson module loads ;-).

- Matt
diff --git a/src/ejson/ejson.erl b/src/ejson/ejson.erl
index 2b26444..78a6c95 100644
--- a/src/ejson/ejson.erl
+++ b/src/ejson/ejson.erl
@@ -27,7 +27,7 @@ init() ->
         filename:join(Dir, ejson)
     end,
     (catch erlang:load_nif(SoName, 0)),
-    ok.
+    case erlang:system_info(version) of "5.7.4" -> true; _ -> ok end.
 
 
 decode(IoList) ->

Reply via email to