在rvm Ruby安装期间运行'__rvm_make -j 1'时出错| openssl错误

时间:2016-02-26 00:41:28

标签: ruby macos rvm homebrew

您可能正在搜索错误运行'__rvm_make -j 1'
这只是说,编译ruby时出了点问题。如果 openssl 和/或 ossl_ssl 是您错误消息的一部分,则此问题仅与您相关。
但也许你的问题是类似的,你可以用一些自定义来解决你的问题。

背景
今天我想删除项目的所有宝石,但忘记事先为bundler指定路径,以便安装在~/.rvm/gems/ruby-2.2.4/gems/中的所有宝石。

因为这是唯一的红宝石2.2.4项目我虽然rm -rf ~/.rvm/gems/ruby-2.2.4/gems/*会非常好。事实并非如此。 Bundler已经不见了,gem install bundler也没有了。

我用rvm remove ruby-2.2.4蚂蚁删除了洞红宝石安装,试图重新安装它。这是控制台输出,出现错误:

控制台输出

> rvm install ruby-2.2.4
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.11/x86_64/ruby-2.2.4.
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/fkammer/.rvm/rubies/ruby-2.2.4, this may take a while depending on your cpu(s)...
ruby-2.2.4 - #downloading ruby-2.2.4, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12.7M  100 12.7M    0     0   655k      0  0:00:19  0:00:19 --:--:--  234k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.2.4 - #extracting ruby-2.2.4 to /Users/fkammer/.rvm/src/ruby-2.2.4....
ruby-2.2.4 - #configuring..........................................................
ruby-2.2.4 - #post-configuration.
ruby-2.2.4 - #compiling..............................................................
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/fkammer/.rvm/log/1456431932_ruby-2.2.4/make.log
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ossl_ssl.c:19:35: note: expanded from macro 'numberof'
#define numberof(ary) (int)(sizeof(ary)/sizeof((ary)[0]))
                                  ^~~~~
ossl_ssl.c:2217:21: error: invalid application of 'sizeof' to an incomplete type 'const struct (anonymous struct at ossl_ssl.c:115:14) []'
    for (i = 0; i < numberof(ossl_ssl_method_tab); i++) {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ossl_ssl.c:19:35: note: expanded from macro 'numberof'
#define numberof(ary) (int)(sizeof(ary)/sizeof((ary)[0]))
                                  ^~~~~
9 errors generated.
make[2]: *** [ossl_ssl.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2
++ return 2
There has been an error while running make. Halting the installation.

重试不会改变任何内容。我还尝试完全卸载rvm(rvm implode)并重新安装它,但这并不成功。

系统
Mac OS X - El Capitan(10.11.3)
rvm 1.26.11(最新)
自制语0.9.5

5 个答案:

答案 0 :(得分:3)

看起来openssl存在问题。

rvm在我的安装中使用homebrew作为其包管理器(我猜这是默认的)。您可以使用rvm autolibs homebrew确保这一点。

我用

重新安装 openssl
brew reinstall openssl

并通过brew list看到我的系统上安装了另一个名为 openssl098 的openssl软件包。尝试重新安装它也导致以下错误:

> brew reinstall openssl098
Error: No available formula with the name "openssl098"

我刚刚用

删除了包裹
brew uninstall --force openssl098

并再次重新安装 openssl ,以确保 openssl098 不是必需的依赖项。但它没有再次安装。

之后我尝试再次通过rvm安装ruby-2.2.4并且它像魅力一样:)所以我想我的openssl包因为某些原因被打破了。

答案 1 :(得分:1)

openssl098Source,已无法播放。很可能你有rvm的过时版本试图建立0.9.8分支。更新rvm以修复此问题:rvm get headRFC 4370

答案 2 :(得分:0)

我试图安装ruby 1.9.3但有错误 - 运行'__rvm_make -j4'时出错

我关注@mpapis并解决了我的问题

rvm remove 1.9.3
CC=clang rvm install 1.9.3

现在我有了这个设置 -

rvm rubies
   ruby-1.9.3-p551 [ x86_64 ]
   ruby-2.1.3 [ x86_64 ]
=* ruby-2.3.1 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

这是源链接 - https://github.com/rvm/rvm/issues/
&安培;这是我对它的引用 - https://github.com/rvm/rvm/issues/2333

答案 3 :(得分:0)

这对我有用。我总是忘记这样做。有一次。

xcode-select --install

答案 4 :(得分:0)

brew --prefix openssl # get the path you need for openssl

rvm install "ruby-2.6.4" --with-openssl-dir=PATH_TO_OPENSSL
相关问题