将MacOS升级到10.14.2 Mojave之后,我无法再使用RVM安装任何Ruby版本。总是会出现这样的错误:
$rvm install 2.5.3
ruby-2.5.3 - #removing src/ruby-2.5.3..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.14/x86_64/ruby-2.5.3.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/jdinse/.rvm/rubies/ruby-2.5.3, this may take a while depending on your cpu(s)...
ruby-2.5.3 - #downloading ruby-2.5.3, this may take a while depending on your connection...
ruby-2.5.3 - #extracting ruby-2.5.3 to /Users/jdinse/.rvm/src/ruby-2.5.3.....
ruby-2.5.3 - #configuring....................................................................
ruby-2.5.3 - #post-configuration.
ruby-2.5.3 - #compiling....................
Error running '__rvm_make -j4',
please read /Users/jdinse/.rvm/log/1547136259_ruby-2.5.3/make.log
There has been an error while running make. Halting the installation.
查看make.log
,唯一的错误是这样的:
making srcs under enc
make[1]: Nothing to be done for `srcs'.
generating transdb.h
linking static-library libruby.2.5.3-static.a
libtool: object: dln.o malformed object (unknown load command 1)
libtool: object: localeinit.o malformed object (unknown load command 1)
libtool: object: loadpath.o malformed object (unknown load command 1)
libtool: object: array.o malformed object (unknown load command 1)
libtool: object: bignum.o malformed object (unknown load command 1)
libtool: object: class.o malformed object (unknown load command 1)
...
到目前为止,我已经尝试过:
这些以及类似问题的其他提示均无济于事。
有什么想法吗?还是知道导致错误libtool: object: dln.o malformed object (unknown load command 1)
的原因以及解决方法?
答案 0 :(得分:2)
我也遇到了这个问题。就我而言,这是由于我升级到(MacOS)Mojave之后MacPorts已过时。
我遵循了MacPorts迁移指南中列出的步骤: https://trac.macports.org/wiki/Migration
关闭并重新打开的终端机(仅b / c)
跑rvm install ruby
并得到Install of ruby-2.6.0 - #complete
,万岁!
答案 1 :(得分:1)
您是否安装了多个版本的boost?我采取了以下步骤来解决此问题(尽管我使用的是rbenv)。
首先,我删除了我的xcode库:
rm -rf /Library/Developer/CommandLineTools
然后我重新安装了它:
xcode-select --install
然后我运行brew ls
,发现我有两个版本的boost。 boost
和boost@1.6.0
。我删除了boost@1.6.0
和boost
并重新安装了boost
,并确保它是通过brew link boost
链接的。
此后似乎可以工作。
答案 2 :(得分:0)
我终于能够通过完全删除MacPorts(非常旧的版本)来修复它。其他所有东西都给我同样的问题。
希望这也对您有效。我花了一天多的时间才能找到提示,使我明白这一点。