Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby -v dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib

Tags:

ruby

dyld

I've been trying to run a script in the terminal and every time I do I get:

$ ruby directory.rb
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
  Referenced from: /Users/claretrembath/.rvm/rubies/ruby-2.1.3/bin/ruby
  Reason: image not found
Trace/BPT trap: 5

I realized that when checking ruby -v I am given the same output:

$ ruby -v
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
  Referenced from: /Users/claretrembath/.rvm/rubies/ruby-2.1.3/bin/ruby
  Reason: image not found
Trace/BPT trap: 5

Any ideas on how to resolve this?

like image 951
czzt Avatar asked Oct 24 '14 20:10

czzt


4 Answers

I just encountered similar issue and was able to resolve it following an answer from superuser.

brew update && brew install gmp && rvm reinstall 2.1.4

Seems this was an issue with libgmp.10.dylib.

like image 179
Jikku Jose Avatar answered Oct 19 '22 14:10

Jikku Jose


For dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib

you need brew update && brew install gmp

like image 41
newBike Avatar answered Oct 19 '22 12:10

newBike


I ended up solving this by including the brew's gmp directory when installing:

rvm install ruby-2.2.5 --with-opt-dir=$(brew --prefix gmp)

like image 1
Nate Delage Avatar answered Oct 19 '22 12:10

Nate Delage


Mine was solved with:

brew update && brew install gmp
brew upgrade npm
like image 1
Will Avatar answered Oct 19 '22 13:10

Will