RVM可以编译Ruby:openssl检查失败

发布于 2025-01-28 22:12:33 字数 2614 浏览 1 评论 0原文

我正在尝试使用rvm在MacOS 11.6.1上安装Ruby 2.7.6。我正在指定酿造已安装的OpenSSL的位置,但日志说这不是正确的版本。一切对我来说都很好。我不确定如何进一步解决问题。详细信息下面。

我执行此命令:

rvm install 2.7.6 --with-openssl-dir=`brew --prefix [email protected]`

RVM日志的相关部分是

openssl:
    Could not be configured. It will not be installed.
    Check ext/openssl/mkmf.log for more details.

ext/openssl/mkmf.log is的相关部分:

checking for OpenSSL version >= 1.0.1 and < 3.0.0... -------------------- no

"gcc -I../../.ext/include/x86_64-darwin20 -I../.././include -I../.././ext/openssl -I/usr/local/include  -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/[email protected]/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe    -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <openssl/opensslv.h>
4: 
5: /*top*/
6: int conftest_const[(OPENSSL_VERSION_NUMBER >= 0x10001000L) ? 1 : -1];
/* end */

"gcc -I../../.ext/include/x86_64-darwin20 -I../.././include -I../.././ext/openssl -I/usr/local/include  -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/[email protected]/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe    -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <openssl/opensslv.h>
4: 
5: /*top*/
6: int conftest_const[(OPENSSL_VERSION_MAJOR >= 3) ? 1 : -1];
/* end */

--------------------

/Users/germuska/.rvm/src/ruby-2.7.6/ext/openssl/extconf.rb:111: OpenSSL >= 1.0.1, < 3.0.0 or LibreSSL >= 2.5.0 is required
    /Users/germuska/.rvm/src/ruby-2.7.6/ext/openssl/extconf.rb:111:in `<top (required)>'
    ./ext/extmk.rb:214:in `load'
    ./ext/extmk.rb:214:in `block in extmake'
    /Users/germuska/.rvm/src/ruby-2.7.6/lib/mkmf.rb:331:in `open'
    ./ext/extmk.rb:210:in `extmake'
    ./ext/extmk.rb:572:in `block in <main>'
    ./ext/extmk.rb:568:in `each'
    ./ext/extmk.rb:568:in `<main>'

I'm trying to install ruby 2.7.6 on MacOS 11.6.1 using rvm. I am specifying the location of a brew-installed openssl but the logs say that it isn't the right version. Everything looks OK to me. I am not sure how to troubleshoot further. Verbose details below.

I execute this command:

rvm install 2.7.6 --with-openssl-dir=`brew --prefix [email protected]`

The relevant part of the RVM log is

openssl:
    Could not be configured. It will not be installed.
    Check ext/openssl/mkmf.log for more details.

The relevant part of ext/openssl/mkmf.log is:

checking for OpenSSL version >= 1.0.1 and < 3.0.0... -------------------- no

"gcc -I../../.ext/include/x86_64-darwin20 -I../.././include -I../.././ext/openssl -I/usr/local/include  -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/[email protected]/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe    -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <openssl/opensslv.h>
4: 
5: /*top*/
6: int conftest_const[(OPENSSL_VERSION_NUMBER >= 0x10001000L) ? 1 : -1];
/* end */

"gcc -I../../.ext/include/x86_64-darwin20 -I../.././include -I../.././ext/openssl -I/usr/local/include  -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/[email protected]/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -g -O2 -fno-common -pipe    -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <openssl/opensslv.h>
4: 
5: /*top*/
6: int conftest_const[(OPENSSL_VERSION_MAJOR >= 3) ? 1 : -1];
/* end */

--------------------

/Users/germuska/.rvm/src/ruby-2.7.6/ext/openssl/extconf.rb:111: OpenSSL >= 1.0.1, < 3.0.0 or LibreSSL >= 2.5.0 is required
    /Users/germuska/.rvm/src/ruby-2.7.6/ext/openssl/extconf.rb:111:in `<top (required)>'
    ./ext/extmk.rb:214:in `load'
    ./ext/extmk.rb:214:in `block in extmake'
    /Users/germuska/.rvm/src/ruby-2.7.6/lib/mkmf.rb:331:in `open'
    ./ext/extmk.rb:210:in `extmake'
    ./ext/extmk.rb:572:in `block in <main>'
    ./ext/extmk.rb:568:in `each'
    ./ext/extmk.rb:568:in `<main>'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清引 2025-02-04 22:12:33

经过仔细审查后,我意识到我有一个openssl目录(包含版本3)/usr/usr/local/local/includ,并且该目录在我指定的目录之前就在包含路径上使用- 带有openssl-dir选项。

我通过重命名/usr/local/includs/openssl将其修复为/usr/local/local/includs/openssl_hideme;之后,扩展编译器找到了我想要的版本。

我会猜测,在命令行上包括的路径将被放在路径前,但是教训学到了。

Upon closer review, I realized I had an openssl directory (containing version 3) in /usr/local/include and that was on the include path ahead of the directory I specfied with the --with-openssl-dir option.

I fixed it by renaming /usr/local/include/openssl to /usr/local/include/openssl_hideme; after that, the extension compiler found the version I wanted.

I would have guessed that includes on the command line would be put in front of the path, but lesson learned.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文