From: "nagachika (Tomoyuki Chikanaga)" Date: 2013-09-17T00:10:11+09:00 Subject: [ruby-core:57231] [ruby-trunk - Bug #8879] String#to_r fails after moving ruby to other OSX system Issue #8879 has been updated by nagachika (Tomoyuki Chikanaga). Thank you for provide the binary. I can reproduce with it. It seems that rb_rational_new2(ZERO, ONE) in read_num() return a Fixnum 0 because canonicalization == 1. I've found that it can be reproduced in trunk with mathn/rational. $ ruby-trunk -r rational/math -e 'p ".8".to_r' 0 mathn/complex and mathn/rational are extension libraries and statically linked with your binary. But mathn.rb doesn't load automatically because it is a pure-ruby library. Add require "mathn" fixes this problem in short. $ ./bin/ruby -rmathn -e 'p ".8".to_r' (4/5) I have no idea why the problem is revealed only when the binary is transferred to other system. nobu, how do you think? ---------------------------------------- Bug #8879: String#to_r fails after moving ruby to other OSX system https://bugs.ruby-lang.org/issues/8879#change-41848 Author: mpapis (Michal Papis) Status: Feedback Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN =begin I got reported by users ((())) that a static binary compiled for OSX after moving to other system fails for the method (({String#to_r})): ruby -e 'puts ".8".to_r' 0 The same binary checked on the build system produces proper result: ruby -e 'puts ".8".to_r' 4/5 Also the same version compiled from source on the target system produces proper result: ruby -e 'puts ".8".to_r' 4/5 Please help me debug the problem, can it be related to compilation with (({clang}))? =end -- http://bugs.ruby-lang.org/