【问题标题】:Ruby installation failedRuby 安装失败
【发布时间】:2020-07-02 23:29:12
【问题描述】:

我正在尝试在 macos Catalina 上使用 rvm 和 rbenv 安装较新版本的 ruby​​ > 2.4。我在自制软件中有最新版本的 openssl。制作 ruby​​ 时该过程失败。
以下是 rbenv 失败前的最后几行

linking miniruby
Undefined symbols for architecture x86_64:
  "_assert", referenced from:
      _enum_sum in enum.o
      _sum_iter in enum.o
      _rb_int_digits_bigbase in numeric.o
      _rb_fix_digits in numeric.o
     (maybe you meant: _rb_assert_failure)
rb_mjit_header.h updated
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [miniruby] Error 1

rvm 的输出是

ruby-2.7.1 - #compiling - please wait
Error running '__rvm_make -j4',
please read /Users/********/.rvm/log/1593732271_ruby-2.7.1/make.log

There has been an error while running make. Halting the installation.

日志

compiling enc/trans/newline.c
./revision.h unchanged
compiling version.c
building rb_mjit_header.h
linking miniruby
rb_mjit_header.h updated
Undefined symbols for architecture x86_64:
  "_assert", referenced from:
      _enum_sum in enum.o
      _sum_iter in enum.o
      _rb_int_digits_bigbase in numeric.o
      _rb_fix_digits in numeric.o
      _range_last in range.o
     (maybe you meant: _rb_assert_failure)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [miniruby] Error 1
+__rvm_make:0> return 2

【问题讨论】:

    标签: ruby macos openssl


    【解决方案1】:

    不要同时使用 rvm 和 rbenv。我不知道究竟会发生什么,但它们可能会相互冲突,因为它们都会尝试控制 Ruby 版本的安装位置以及如何选择正确的版本。

    我会完全卸载这两个,撤消您为 rbenv 和 rvm 所做的 .bashrc/.zshrc/.bash_profile 等中的任何内容。

    然后,从一个或另一个重新开始。

    【讨论】:

    • 最初,我只有一个 rvm,并且在尝试了多种解决方案后才添加了 rbenv。我听从了你的建议,但问题是一样的。
    • 你能粘贴完整的输出吗?清除所有内容,然后粘贴输入rbenv install 2.7.1rvm install 2.7.1 后输出的所有内容。这些编译错误通常与 OSX 上的 C 编译依赖有关,如命令行工具、gcc 等。
    猜你喜欢
    • 2014-06-13
    • 1970-01-01
    • 1970-01-01
    • 2011-05-06
    • 2014-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多