-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
String#to_r is broken on 2.0.0-p247 Mac binaries #2189
Comments
I have just tried and can not reproduce this behavior, can you please try this: rvm get head
rvm reload
rvm reinstall 2.0.0 --binary
rvm use 2.0.0
ruby -e 'puts ".8".to_r' |
I'm getting the bug reproduced over here when following those commands (MBP Retina, mid-2012, OS X 10.8.4): ➜ ~ rvm get head
Downloading RVM from wayneeseguin branch master
Upgrading the RVM installation in /Users/yoni/.rvm/
RVM PATH line found in /Users/yoni/.bashrc /Users/yoni/.zshrc.
RVM sourcing line found in /Users/yoni/.bash_login /Users/yoni/.zprofile.
Upgrade of RVM in /Users/yoni/.rvm/ is complete.
...
RVM reloaded!
➜ ~ rvm reload
RVM reloaded!
➜ ~ rvm reinstall 2.0.0 --binary
Removing /Users/yoni/.rvm/src/ruby-2.0.0-p247... - using Zsh, can not show progress, be patient...
Removing /Users/yoni/.rvm/rubies/ruby-2.0.0-p247... - using Zsh, can not show progress, be patient...
Searching for binary rubies, this might take some time.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.
Requirements installation successful.
...
ruby-2.0.0-p247 - #validate archive
ruby-2.0.0-p247 - #extract
ruby-2.0.0-p247 - #validate binary
ruby-2.0.0-p247 - #setup
Saving wrappers to '/Users/yoni/.rvm/wrappers/ruby-2.0.0-p247'...........
ruby-2.0.0-p247 - #importing default gemsets, this may take time.......................
Making gemset ruby-2.0.0-p247 pristine. - using Zsh, can not show progress, be patient...
Making gemset ruby-2.0.0-p247@global pristine. - using Zsh, can not show progress, be patient...
➜ ~ rvm use 2.0.0
Using /Users/yoni/.rvm/gems/ruby-2.0.0-p247
➜ ~ ruby -e 'puts ".8".to_r'
0 But then installing from source again fixes the issue: ➜ ~ rvm reinstall ruby-2.0 --disable-binary
/Users/yoni/.rvm/src/ruby-2.0.0-p247 has already been removed.
Removing /Users/yoni/.rvm/rubies/ruby-2.0.0-p247... - using Zsh, can not show progress, be patient...
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/yoni/.rvm/rubies/ruby-2.0.0-p247, this may take a while depending on your cpu(s)...
ruby-2.0.0-p247 - #downloading ruby-2.0.0-p247, this may take a while depending on your connection...
ruby-2.0.0-p247 - #extracting ruby-2.0.0-p247 to /Users/yoni/.rvm/src/ruby-2.0.0-p247 - using Zsh, can not show progress, be patient...
ruby-2.0.0-p247 - #extracted to /Users/yoni/.rvm/src/ruby-2.0.0-p247
Applying patch /Users/yoni/.rvm/patches/ruby/2.0.0/logging.patch - using Zsh, can not show progress, be patient...
ruby-2.0.0-p247 - #configuring - using Zsh, can not show progress, be patient...
ruby-2.0.0-p247 - #post-configuration - using Zsh, can not show progress, be patient...
ruby-2.0.0-p247 - #compiling - using Zsh, can not show progress, be patient...
ruby-2.0.0-p247 - #installing - using Zsh, can not show progress, be patient...
Retrieving rubygems-2.0.7
Extracting rubygems-2.0.7 ...
Removing old Rubygems files...
Installing rubygems-2.0.7 for ruby-2.0.0-p247...
Installation of rubygems completed successfully.
Saving wrappers to '/Users/yoni/.rvm/wrappers/ruby-2.0.0-p247'...........
- using Zsh, can not show progress, be patient...
ruby-2.0.0-p247 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-2.0.0-p247 - #importing default gemsets, this may take time - using Zsh, can not show progress, be patient...
Install of ruby-2.0.0-p247 - #complete
Making gemset ruby-2.0.0-p247 pristine. - using Zsh, can not show progress, be patient...
Making gemset ruby-2.0.0-p247@global pristine. - using Zsh, can not show progress, be patient...
➜ ~ rvm use 2.0.0
Using /Users/yoni/.rvm/gems/ruby-2.0.0-p247
➜ ~ ruby -e 'puts ".8".to_r'
4/5 |
can you try on the broken one: ruby -e 'puts Rational("0.8")' -e 'puts Rational(".8")' |
Binary ruby: ➜ ~ ruby -e 'puts Rational("0.8")' -e 'puts Rational(".8")'
0
0 Source ruby: ➜ ~ ruby -e 'puts Rational("0.8")' -e 'puts Rational(".8")'
4/5
4/5 |
I'm afraid this can be because of compilation with clang, I will have to catch up someone from ruby team to investigate, please for now use source install (this is the only issue I know of) |
reported it to MRI, I can not do much without their help => https://bugs.ruby-lang.org/issues/8879 |
I just tried, but:
|
@nobu what version of OSX is that? the binary we have is for 10.8 ... but you could try it on other version system with: rvm mount -r http://rvm.io/binaries/osx/10.8/x86_64/ruby-2.0.0-p247.tar.bz2 --verify-downloads 1 although I'm not sure it will work correctly in versions lower then 10.8 |
It's 10.7.5. |
I will try to prepare version that is compatible with older osx ... but this might take some time |
Is it possible this issue might be causing problems when running Calabash/Cucumber tests in RubyMine? I ended up having to roll back RVM to version 1.22.3 in order to use Ruby 2.0. |
@nobu I have uploaded binary that works also on 10.6 / 10.7 - you can try it with: rvm get head
rvm install 2.0.0 --binary as for the error as explained so far in the ticket for MRI this works: require 'mathn'
"0.4".to_r |
It worked properly. |
@nobu you were able to reproduce the error or it works for you? |
I got the correct result |
also with: ruby -e 'puts Rational("0.8")' -e 'puts Rational(".8")' |
Not sure if it matters, but all of the boxes that I've seen exhibiting the problem have been using Homebrew. I don't have access to a machine using MacPorts. |
rvm uses SM Framework for building "static" ruby for OSX, I guess almost nobody will have that |
the pre-compiled binary still seems broken on 10.8? compiling from source solves it. |
ok so there is a ruby commit 43514 that can be tested with this patch https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/43514/diff/load.c?format=diff ... unfortunately my OSX machine has to go back to EngineYard for data cleaning and I can not work on this right now (I should get it back someday), maybe @rys will be able work faster on this then me. |
unfortunately the patch does not help, related => 1d2de5a |
it appears the new patch breaks |
I have recently uploaded |
it works for me in latest binaries moved to other version of OSX - closing - if anyone has still issues please let me know |
I noticed a problem with the rvm 2.0.0-p247 binary for OS X, repeatable across different machines.
The last answer is the correct one. This causes lots of problems with ActiveRecord + PostgreSQL since it ends up truncating timestamps to integers instead of keeping millisecond precision.
The text was updated successfully, but these errors were encountered: