我正在尝试(重新)使用rvm 1.29.1在运行OS X Sierra的全新MBP上安装ruby 1.8.7.我HAVE完成这件事的工作,我不是在一个位置切换到更新版本或任何不幸.
我有一个功能安装,但在一个项目中得到一些奇怪的错误后决定尝试完全干净的重新安装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.
Run Code Online (Sandbox Code Playgroud)
我已经尝试了在Mountain Lion(10.8)上安装Getting Ruby 1.8.7中建议的一些黑客,但遗憾的是没有帮助.进一步查看日志文件,错误从以下消息开始:
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))
Run Code Online (Sandbox Code Playgroud)
搜索此错误的第一行在此处返回0结果.我们将非常感谢您的建议.
小智 5
我能够使用rbenv代码的变体通过RVM实现这一点我发现@ https://gist.github.com/davidkellis/909449e13905d8bfbd49c30d20f7fbca.我已经有了xcode和openssl.
rvm install 1.8.7 --with-openssl-dir=`brew --prefix openssl`
Run Code Online (Sandbox Code Playgroud)