Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dwbutler opened this issue Mar 4, 2013 · 14 comments
Closed

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

dwbutler opened this issue Mar 4, 2013 · 14 comments

Comments

@dwbutler
Copy link

dwbutler commented Mar 4, 2013

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
Copy link

Found the same issue "undefined symbol: rb_infinity"

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

@portertech
Copy link

@ohler55 Any ideas? Seems that CentOS is problematic https://github.com/ohler55/oj/blob/master/ext/oj/extconf.rb#L38

@ohler55
Copy link
Owner

ohler55 commented Mar 5, 2013

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
Copy link

Ok, great, trying it on 5.7 now.

@portertech
Copy link

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:inrequire'
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:inrequire'
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:inrequire'
from (irb):1
from /opt/sensu/embedded/bin/irb:12:in `

'

@portertech
Copy link

@ohler55 no luck :(

@portertech
Copy link

@ohler55 seems that dump.c also uses INFINITY

@ohler55
Copy link
Owner

ohler55 commented Mar 5, 2013

Okay, fixed it.

@portertech
Copy link

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

@portertech
Copy link

@ohler55 That did it 👍

@portertech
Copy link

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

@ohler55
Copy link
Owner

ohler55 commented Mar 5, 2013

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

@dwbutler
Copy link
Author

dwbutler commented Mar 5, 2013

Thanks! I'll try it tomorrow.

@dwbutler
Copy link
Author

dwbutler commented Mar 5, 2013

It worked! Thanks so much!

@dwbutler dwbutler closed this as completed Mar 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants