macos - 在 osx 上安装 ruby​​ 2.3 时出错

标签 macos rvm ruby-2.3

尝试在 osx 上安装 2.3 ruby​​ 时出现错误
我已将 rvm 更新为稳定的 1.27.0
然后我正在尝试安装 2.3

% rvm install 2.3
ruby-2.3.0 - #removing src/ruby-2.3.0 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.11/x86_64/ruby-2.3.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/password123/.rvm/rubies/ruby-2.3.0, this may take a while depending on your cpu(s)...
ruby-2.3.0 - #downloading ruby-2.3.0, this may take a while depending on your connection...
ruby-2.3.0 - #extracting ruby-2.3.0 to /Users/password123/.rvm/src/ruby-2.3.0 - please wait
ruby-2.3.0 - #configuring - please wait
ruby-2.3.0 - #post-configuration - please wait
ruby-2.3.0 - #compiling - please wait
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/password123/.rvm/log/1460728216_ruby-2.3.0/make.log
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ossl_ssl.c:18:35: note: expanded from macro 'numberof'
#define numberof(ary) (int)(sizeof(ary)/sizeof((ary)[0]))
                                  ^~~~~
ossl_ssl.c:2266:21: error: invalid application of 'sizeof' to an incomplete type 'const struct (anonymous struct at ossl_ssl.c:85:14) []'
    for (i = 0; i < numberof(ossl_ssl_method_tab); i++) {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ossl_ssl.c:18:35: note: expanded from macro 'numberof'
#define numberof(ary) (int)(sizeof(ary)/sizeof((ary)[0]))
                                  ^~~~~
4 warnings and 10 errors generated.
make[2]: *** [ossl_ssl.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2
+__rvm_make:0> return 2
There has been an error while running make. Halting the installation.  

你能告诉我修复这个错误的任何步骤吗?

最佳答案

基于 this rbenv discussion ,我能够通过卸载、重新安装和强制链接 Homebrew OpenSSL 来解决这个问题:

brew uninstall --force openssl
brew install openssl
brew link --overwrite openssl --force
rvm install 2.3.0

如果我知道 brew link 可能有什么副作用,我会感觉更好,但它确实有效。

关于macos - 在 osx 上安装 ruby​​ 2.3 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36649357/

相关文章:

ruby - 安装 RVM 后找不到 Ruby 1.9.2

ruby-on-rails - 为什么 Rails 使用错误版本的 Ruby?

macos - mac 上进程的内存快照?

rvm - 如何找到 .bash_profile 并将其添加到我的 shell 的初始化文件中?

macos - 有没有办法根据型号获取 Mac 的图标?

ruby - 如何使用卡住的字符串文字启动 Rack 应用程序?

ruby - 在 Ruby 中,为什么 nil[1]=1 的计算结果为 nil?

尝试放置文字哈希时出现 Ruby 语法错误

swift - 如何知道我的非 ViewController 类是否已加载(如 viewDidLoad)

macos - Mac OS X/打开具有指定窗口的终端