Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Ruby 2.0.0-p0 issue - 'undefined symbol: rb_infinity' #74

Closed
dwbutler opened this Issue · 14 comments

3 participants

@dwbutler

Hi,

I'm having a strange issue using Oj in Ruby 2.0.0-p0. This seems to affect multiple versions of Oj including the most recent (2.0.7). What's strange is that we only encounter this error on a specific CentOS build. It works fine everywhere else we've tried - MacOSX, and Amazon EC2.

Here is the error we are getting when launching our Rails app:

undefined symbol: rb_infinity - /var/www/app/shared/bundle/ruby/2.0.0/gems/oj-2.0.7/ext/oj/oj.so (LoadError)
    from /var/www/app/shared/bundle/ruby/2.0.0/gems/backports-2.6.7/lib/backports/tools.rb:314:in `require_with_backports'
    from /var/www/app/shared/bundle/ruby/2.0.0/gems/oj-2.0.7/lib/oj.rb:33:in `<top (required)>'

And here are some details of our OS:

cat /proc/version
Linux version 2.6.18-238.12.1.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Tue May 31 13:22:04 EDT 2011

uname -a
Linux xxx 2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:22:04 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

We installed Ruby 2.0.0 using RVM. Could the Ruby build itself be misconfigured?

@portertech

Found the same issue "undefined symbol: rb_infinity"

Ruby built w/ https://github.com/sensu/sensu-build/blob/master/recipes/ruby.rake

@ohler55
Owner

Apparently CentOS has some issues with math.h and ruby.h that revolve around INFINITY. I checked in something I think will work around the problem. Please pull and see if it works with CentOS. If it works I will do a release.

@portertech

Ok, great, trying it on 5.7 now.

@portertech

irb(main):001:0> require 'oj'
LoadError: /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/oj-2.0.9a1/ext/oj/oj.so: undefined symbol: rb_infinity - /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/oj-2.0.9a1/ext/oj/oj.so
from /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require'
from /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
require'
from /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/oj-2.0.9a1/lib/oj.rb:33:in <top (required)>'
from /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in
require'
from /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in rescue in require'
from /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in
require'
from (irb):1
from /opt/sensu/embedded/bin/irb:12:in `

'

@portertech

@ohler55 no luck :(

@portertech

@ohler55 seems that dump.c also uses INFINITY

@ohler55
Owner

Okay, fixed it.

@portertech

/opt/sensu/embedded/bin/irb

irb(main):001:0> require 'oj'
=> true
irb(main):002:0> Oj.load('{"foo": "bar"}')
=> {"foo"=>"bar"}

@portertech

@ohler55 That did it :+1:

@portertech

@ohler55 I'm looking forward to the new release, thank you!

@ohler55
Owner

Just completed the release. Thanks for the help with the problem.

@dwbutler

Thanks! I'll try it tomorrow.

@dwbutler

It worked! Thanks so much!

@dwbutler dwbutler closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.