Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t安装ruby 1.8.7 Mac OS X_Ruby_Macos_Rvm - Fatal编程技术网

Can';t安装ruby 1.8.7 Mac OS X

Can';t安装ruby 1.8.7 Mac OS X,ruby,macos,rvm,Ruby,Macos,Rvm,我正在尝试(重新)安装ruby 1.8.7,使用rvm 1.29.1在运行OS X Sierra的全新MBP上。我必须完成这项工作,不幸的是,我无法切换到更新的版本或任何东西 我安装了这个功能,但在一个项目中出现一些奇怪的错误后,我决定尝试完全干净地重新安装rvm(最终是自制的!)(说来话长,在从我的主目录名称中删除了不需要的空间后,文件结构被破坏了!)。在这里的其他帖子之后,我小心地从.bashrc、.profile等中删除了旧安装的所有痕迹。2.4.0安装和运行良好。但是,在尝试安装1.8.

我正在尝试(重新)安装ruby 1.8.7,使用rvm 1.29.1在运行OS X Sierra的全新MBP上。我必须完成这项工作,不幸的是,我无法切换到更新的版本或任何东西

我安装了这个功能,但在一个项目中出现一些奇怪的错误后,我决定尝试完全干净地重新安装rvm(最终是自制的!)(说来话长,在从我的主目录名称中删除了不需要的空间后,文件结构被破坏了!)。在这里的其他帖子之后,我小心地从.bashrc、.profile等中删除了旧安装的所有痕迹。2.4.0安装和运行良好。但是,在尝试安装1.8.7时:

9bxbniv1:~ Rob$ rvm install ruby-1.8.7

Warning! Requested ruby installation which requires another ruby available - installing ruby-1.8.7-p374 first.

ruby-1.8.7-p374 - #removing src/ruby-1.8.7-p374..
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl@1.1/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/Rob/.rvm/rubies/ruby-1.8.7-p374, this may take a while depending on your cpu(s)...
ruby-1.8.7-p374 - #downloading ruby-1.8.7-p374, this may take a while depending on your connection...
ruby-1.8.7-p374 - #extracting ruby-1.8.7-p374 to /Users/Rob/.rvm/src/ruby-1.8.7-p374....
ruby-1.8.7-p374 - #applying patch /Users/Rob/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch.
ruby-1.8.7-p374 - #applying patch /Users/Rob/.rvm/patches/ruby/1.8.7/no_sslv2.diff.
ruby-1.8.7-p374 - #applying patch /Users/Rob/.rvm/patches/ruby/GH-488.patch.
ruby-1.8.7-p374 - #applying patch /Users/Rob/.rvm/patches/ruby/ssl_no_ec2m.patch.
ruby-1.8.7-p374 - #configuring...............................
ruby-1.8.7-p374 - #post-configuration.
ruby-1.8.7-p374 - #compiling................................
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/Rob/.rvm/log/1488471654_ruby-1.8.7-p374/make.log
                            ^
openssl_missing.c:107:28: error: dereferencing pointer to incomplete type
     EVP_MD_CTX_cleanup(&ctx->o_ctx);
                            ^
openssl_missing.c:108:28: error: dereferencing pointer to incomplete type
     EVP_MD_CTX_cleanup(&ctx->md_ctx);
                            ^
In file included from /usr/include/string.h:192:0,
                 from openssl_missing.c:19:
openssl_missing.c:109:27: error: invalid application of 'sizeof' to incomplete type 'HMAC_CTX'
     memset(ctx, 0, sizeof(HMAC_CTX));
                           ^
make[1]: *** [openssl_missing.o] Error 1
make: *** [all] Error 1
+++ return 2
There has been an error while running make. Halting the installation.

To proceed rvm requires a ruby-1.8.7-p374 compatible ruby is installed.
We attempted to install it automatically but it failed with status 2.
Please install it manually (or a compatible alternative) to proceed.
我已经尝试了中建议的一些黑客,但不幸的是,没有帮助。 进一步查看日志文件,错误以以下消息开头:

In file included from openssl_missing.c:22:0:
openssl_missing.h:79:35: error: macro "EVP_MD_CTX_create" passed 1 arguments, but takes just 0
 EVP_MD_CTX *EVP_MD_CTX_create(void);
                                   ^
In file included from /usr/local/opt/openssl@1.1/include/openssl/x509.h:23:0,
                 from /usr/local/opt/openssl@1.1/include/openssl/x509_vfy.h:17,
                 from openssl_missing.c:16:
/usr/local/opt/openssl@1.1/include/openssl/evp.h:501:51: error: expected declaration specifiers or '...' before '(' token
 # define EVP_MD_CTX_init(ctx)    EVP_MD_CTX_reset((ctx))

搜索此错误的第一行在此处返回0个结果。非常感谢您的建议。

Ruby 1.8.7已经过时,任何现代macOS都不再支持它,因此您无法安装它。这个版本的Ruby在这一点上是一个历史工件,如果你真的,真的需要运行它,你要么需要一个与它兼容的OS X,Linux或BSD的历史版本

我的建议是使用构建一个虚拟机,该虚拟机具有较旧版本的Linux或BSD,可用于构建Ruby 1.8.7。任何可以追溯到2010年或更早的版本都可能会成功,所以Ubuntu 10.04可能是一个很好的起点


值得注意的是,1.8.7的一个变体比MRI 1.8.7支持的时间更长,因此您可能会在该版本中获得更大的成功。它于2012年停产。

RVM的最新开发版本应该可以:

rvm get head
在升级RVM之前,我还将XCode更新为8.2.1版,如果您确实升级了XCode,则需要启动它并同意新的许可证,或者:

sudo xcodebuild -license
我还必须升级我的brew,并进行加载以使其正常工作,因为它已经很长时间没有被触摸了

我不确定你是否可以单独做一个。我的车现在已经开动了


我用核武器炸了我的RVM,因为我让它失控了。但愿我能把它剪掉。现在让传统的Rails应用程序启动并运行。

我最终使用time machine恢复了我的系统。但另一位同事在安装新机器时遇到同样的问题,并发现

rvm install ruby -v 1.8.7--autolibs=enable

如果有人偶然发现了这一点,这将非常有用。

我能够通过RVM使用我找到的rbenv代码的变体来实现这一点。我已经有了xcode和openssl

rvm install 1.8.7 --with-openssl-dir=`brew --prefix openssl`

看起来您需要获得旧版本的openssl链接against@JimDeville这比那要复杂得多。老版本的OpenSSL不太可能编译,这会导致更多的问题。谢谢你的建议。令人恼火的是,它使用的是我以前的配置(否则就是不可靠的)。在这里,区别在于rvm使用了一种变通方法来避免我的主目录中的空间,在/中创建Rob.rvm,而不是/Users/Rob。看看图…
rvm
是一个很棒的工具,但如果你不小心的话,它可能真的会运行错误。警告:openssl 1.0.2l已经安装警告:libyaml 0.1.7已经安装警告:libffi 3.2.1已经安装apple-gcc42:这个公式在比Mavericks更新的macOS版本上,因为上游不相容性。错误:未满足的要求使此生成失败。这是自制或RVM的问题吗?