yajl-ruby icon indicating copy to clipboard operation
yajl-ruby copied to clipboard

wrong argument type nil (expected Fixnum) (TypeError)

Open cheyang opened this issue 11 years ago • 4 comments

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:inparse' from test.rb:4:in `

'

May I know what's wrong with it?

cheyang avatar Jan 12 '14 16:01 cheyang

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

d avatar Jan 12 '14 17:01 d

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!

brianmario avatar Jan 13 '14 04:01 brianmario

Can we close this given the likelihood of user error and inactivity?

d avatar May 06 '14 14:05 d

Sure, please

cheyang avatar Aug 20 '14 08:08 cheyang