Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrading to Ruby 2.1.3 on Mac OSx 10.9.5

Today I upgraded to Ruby 2.1.3 from 2.0.0 on Mac OSx 10.9.5. It turned out to be more difficult than initially expected. And since I wasted a hell lot of time I thought I share my experiences plus solution in case someone else hits the problem as well.

I have xcode + developer tools installed. I updated xcode this week as well - not sure if that was the reason why things suddenly didn't work. However, here are the facts:

$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

$ rvm -v
rvm 1.25.32 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]

$ brew -v
Homebrew 0.9.5

$ git version
git version 1.9.3 (Apple Git-50)

Getting the latest version of Ruby and using it as default:

$ rvm install ruby
$ rvm --default use ruby-2.1.3

Now the issue is that if I tried to check ruby version I got the following:

$ rvm --default use ruby-2.1.3
Using /Users/georg/.rvm/gems/ruby-2.1.3
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
  Referenced from: /Users/georg/.rvm/rubies/ruby-2.1.3/bin/ruby
  Reason: image not found

In fact nothing was really working - I tried to reload RVM, reinstall, re-install and upgrade homebrew, etc.

$ brew update && brew upgrade

$ rvm reload

Reinstalled ruby

$ rvm install ruby-2.1.3
Already installed ruby-2.1.3.
To reinstall use:

    rvm reinstall ruby-2.1.3

And many other solutions - however, it all did not do the trick.

So I checked if I have /usr/local/lib/libcloog-isl.4.dylib

$ ls -la /usr/local/lib/libcloog-isl.4.dylib 

Which didn't give anything back ...

like image 929
Georg Keferböck Avatar asked Oct 03 '14 17:10

Georg Keferböck


2 Answers

So the solution, which resolved the issue is to run the following:

$ brew rm cloog; brew install cloog 

Ta-Ta. It all worked all of the sudden!

$ ruby -v
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin13.0]
like image 60
Georg Keferböck Avatar answered Nov 01 '22 20:11

Georg Keferböck


This is a known issue with the binary version of Ruby 2.1.3 that RVM installs. Michal Papis, the maintainer of RVM, hasn't put fixing this at the top of his priority list at the moment. The correct solution is to reinstall Ruby 2.1.3 without the binary, like this:

rvm reinstall 2.1.3 --disable-binary

See these RVM GitHub issues to see Michal's comments about this issue: https://github.com/wayneeseguin/rvm/issues/3068

https://github.com/wayneeseguin/rvm/issues/3094

like image 41
monfresh Avatar answered Nov 01 '22 19:11

monfresh