not working with rubinius #132

Closed
kritik opened this Issue Dec 31, 2013 · 18 comments

Comments

Projects
None yet
4 participants

kritik commented Dec 31, 2013

I have

rvm list
rvm rubies
=> rbx-2.2.2 [ x86_64 ]

gem install oj
Building native extensions.  This could take a while...
Successfully installed oj-2.5.1
1 gem installed

irb           
rubinius-2.2.2 :001 > require 'oj'
NameError: Missing or uninitialized constant: Oj::Bag
        from kernel/common/module.rb:674:in `const_missing'
        from /home/kritik/.rvm/gems/rbx-2.2.2/extensions/x86_64-linux/2.1.0/oj-2.5.1/oj.so:in `Init_oj'
        from kernel/common/native_method.rb:43:in `load_extension'
        from kernel/delta/code_loader.rb:282:in `load_library'
        from kernel/common/code_loader.rb:130:in `require'
        from kernel/common/code_loader.rb:237:in `require'
        from kernel/common/kernel.rb:705:in `gem_original_require (require)'
        from /home/kritik/.rvm/rubies/rbx-2.2.2/site/rubygems/core_ext/kernel_require.rb:135:in `require'
        from (irb):1
        from kernel/common/block_environment.rb:53:in `call_on_instance'
        from kernel/common/eval.rb:176:in `eval'
        from kernel/common/kernel.rb:460:in `loop'
        from kernel/bootstrap/proc.rb:20:in `call'
        from kernel/common/throw_catch.rb:30:in `catch'
        from kernel/common/throw_catch.rb:8:in `register'
        from kernel/common/throw_catch.rb:29:in `catch'
        from kernel/bootstrap/proc.rb:20:in `call'
        from kernel/common/throw_catch.rb:30:in `catch'
        from kernel/common/throw_catch.rb:8:in `register'
        from kernel/common/throw_catch.rb:29:in `catch'
        from /home/kritik/.rvm/gems/rbx-2.2.2@global/gems/rubysl-irb-2.0.4/bin/irb:12:in `__script__'
        from kernel/common/kernel.rb:447:in `load'
        from /home/kritik/.rvm/gems/rbx-2.2.2@global/bin/irb:19:in `__script__'
        from kernel/delta/code_loader.rb:66:in `load_script'
        from kernel/delta/code_loader.rb:200:in `load_script'
        from kernel/loader.rb:649:in `script'
        from kernel/loader.rb:831:in `main'rubinius-2.2.2 :002 > exit
Owner

ohler55 commented Jan 2, 2014

I'm having a tough time reproducing this. I have not been able to install rbi 2.2.2 or 2.2.3 with rbenv but I have been able to build with the latests rubinius on github. With that version I have no problems. Oj load fine. Have you tried building a version from github and seeing if you have the same problem still?

kritik commented Jan 2, 2014

yes, the same

rvm reinstall rbx-head
rbx-head - #removing src - please wait
Checking requirements for ubuntu.
Requirements installation successful.
HEAD is now at 18c2577 Fix thread shutdown race condition
...
Owner

ohler55 commented Jan 2, 2014

Ubuntu, I'll try that.

ohler55 referenced this issue in rubinius/rubinius Jan 8, 2014

Closed

Uninitialize constant with C extension #2877

Owner

ohler55 commented Jan 13, 2014

While waiting for a reply from the Rubinius team would you like to try the latest on github? I tried putting the requires in the C code in case Rubinius is deleting the Oj module before calling init on it.

Owner

ohler55 commented Jan 16, 2014

Does 2.5.4 work for you?

kritik commented Jan 17, 2014

Hi,
tried latest version from github and wasn't able to run irb... waiting for
some update

2014/1/17 Peter Ohler notifications@github.com

Does 2.5.4 work for you?


Reply to this email directly or view it on GitHubhttps://github.com/ohler55/oj/issues/132#issuecomment-32556735
.

Vladimir Krylov
http://vladimir.it.cx

Owner

ohler55 commented Jan 17, 2014

Same error or something different?

kritik commented Jan 17, 2014

that's rubinius problem, so I'll do some investigations

2014/1/17 Peter Ohler notifications@github.com

Same error or something different?


Reply to this email directly or view it on GitHubhttps://github.com/ohler55/oj/issues/132#issuecomment-32644621
.

Vladimir Krylov
http://vladimir.it.cx

kritik commented Jan 20, 2014

Ok, I was able to built rubinius and can require oj. The only thin what I've marked is that BigDecimal is not required.

rbx           
rbx-head :001 > require 'oj'
NameError: Missing or uninitialized constant: BigDecimal
        from kernel/common/module.rb:674:in `const_missing'

But if I require big decimal - everything works perfectly. Is it ok?

Anyway, thanks a lot.

kritik closed this Jan 20, 2014

Owner

ohler55 commented Jan 20, 2014

There is an issue with big decimal and rbx that I haven't solved. If it is required in the C extension that fails. If outside then it is fine. I have not found a work around for that bug in rbx.

rep commented Feb 18, 2014

I'm not sure this issue should be closed - in the end working around this on the rubinius side isn't really an option (most base stuff implemented in ruby, smaller C part). But fixing it on the OJ side could be possible by determining the availability of the bigdecimal C side, and if it isn't there replace the code with a small wrapper that calls into the ruby version of it.

Or am I missing something? (I'm not really a ruby expert, but just running into the issue)

Owner

ohler55 commented Feb 19, 2014

It probably should not have been closed. I'll do a release with the require in the ruby file as well. That should take care of the bug in Rubinius.

jfabre commented Sep 21, 2014

I know this is out of nowhere, but I'm just wondering if Oj is compatible with Rubinius now.
thanks!

Owner

ohler55 commented Sep 21, 2014

As far as I know it is. I have not tried the latest since it is hard to get rbx built but it still works on the older one. Is it no longer works I will fix it.

On September 21, 2014 7:33:51 AM PDT, Jeremy Fabre notifications@github.com wrote:

I know this is out of nowhere, but I'm just wondering if Oj is
compatible with Rubinius now.
thanks!


Reply to this email directly or view it on GitHub:
#132 (comment)

Owner

ohler55 commented Sep 21, 2014

I'll take a look at it this week to make sure it works.

Owner

ohler55 commented Sep 21, 2014

I guess I will not look at it. I broke by 2.2.6 install and have not been able to reinstall it or 2.2.10 from rbenv or from source taken from the rub ini.us site. From git also failed to finished building. The travis build still seems to work though.

jfabre commented Sep 22, 2014

Ok, no problem. Thanks for taking the time. I really like your gem btw! :)

Owner

ohler55 commented Sep 22, 2014

Nice to have the feedback, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment