yajl-ruby
yajl-ruby copied to clipboard
wrong argument type nil (expected Fixnum) (TypeError)
execute test.rb, and the content of test.rb: require 'yajl/json_gem' include JSON configs = JSON.parse('{"hello": "goodbye"}') puts configs
But got the error:
wrong argument type nil (expected Fixnum) (TypeError)
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/yajl-ruby-1.1.0/lib/yajl.rb:42:in parse' from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/yajl-ruby-1.1.0/lib/yajl/json_gem/parsing.rb:13:in
parse'
from test.rb:4:in `
May I know what's wrong with it?
Can you reproduce this with Ruby version 2.1.0
? The error message gives me the impression that the C extension was compiled under 1.9
Yeah this definitely looks like the gem was compiled against a different version of Ruby than is being used at runtime. Can you wipe out the install of yajl-ruby and reinstall making sure you're using the right version of Ruby and let us know if that fixes it for you? Thanks!
Can we close this given the likelihood of user error and inactivity?
Sure, please