如何修复"dyld:库未加载:/usr/local/opt/gmp/lib/libgmp.10.dylib"永久使用Ruby? [英] How to fix "dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib" permanently for Ruby?
问题描述
大约2周前,我更新了操作系统,此后一直遇到此问题:
I updated my OS about 2 weeks ago, and since then I've been running into this issue:
> ruby -v
dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
Referenced from: /Users/me/.rvm/rubies/ruby-2.2.1/bin/ruby
Reason: image not found
[1] 65487 trace trap ruby -v
在此处找到解决方案(Ruby -v dyld:未加载库:/usr/local/lib/libgmp.10.dylib )适用于每个终端会话,但不是永久的.我正在运行OS 10.9.5.
A solution found here (Ruby -v dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib) works for each terminal session, but not permanently. I am running OS 10.9.5.
这是暂时可行的方法:
rvm reinstall 2.1.4
除了更新自制程序之外,这没有任何作用
This has no effect, other than update homebrew:
brew update && brew install gmp
如何永久解决此问题?
推荐答案
您可能需要将 ruby
, gmp
和 rvm
软件包重新安装到修复损坏的依赖项,例如
You probably need to reinstall ruby
, gmp
and rvm
packages to fix the broken dependencies, e.g.
brew reinstall gmp rvm ruby
考虑运行 brew update&&冲泡升级
.
然后将 ruby
重新安装为:
rvm reinstall 2.1.4 --with-opt-dir=$(brew --prefix gmp) --disable-binary
然后通过以下方式进行检查:
Then check by:
ruby -v
请确保您使用的是正确的 ruby
(检查方式: which -a ruby
),否则请为 PATH设置正确的顺序您的启动Shell脚本中的code>变量(例如
〜/.bash_profile
).
Make sure you're using the right ruby
(check by: which -a ruby
), if not, setup the right order for PATH
variable in your startup shell scripts (e.g. ~/.bash_profile
).
还要确保您没有覆盖启动外壳程序脚本中的任何 DYLD_LIBRARY_PATH
, DYLD_FALLBACK_LIBRARY_PATH
或 DYLD_FRAMEWORK_PATH
变量(例如,〜/.bash_profile
).
Also make sure you're not overriding any DYLD_LIBRARY_PATH
, DYLD_FALLBACK_LIBRARY_PATH
or DYLD_FRAMEWORK_PATH
variables from the startup shell scripts (e.g. ~/.bash_profile
).
相关: RVM的Ruby安装问题.
这篇关于如何修复"dyld:库未加载:/usr/local/opt/gmp/lib/libgmp.10.dylib"永久使用Ruby?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!