代码之家  ›  专栏  ›  技术社区  ›  Frederik Kammer

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

  •  3
  • Frederik Kammer  · 技术社区  · 10 年前

    您可能正在搜索 运行“__rvm_make-j 1”时出错
    这只说明编译ruby时出错了。此问题仅在以下情况下与您相关 openssl 和/或 ossl_ssl 是错误消息的一部分。
    但也许你的问题是 相像的 一个,你可以通过一些定制来解决你的问题。


    出身背景
    今天我想删除一个项目的所有gem,但忘了事先指定bundler的路径,所以所有gem都安装在 ~/.rvm/gems/ruby-2.2.4/gems/ .

    因为这是我认为唯一的ruby 2.2.4项目 rm -rf ~/.rvm/gems/ruby-2.2.4/gems/* 那就很好了。事实并非如此。邦德勒走了 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 回复  |  直到 10 年前
        1
  •  3
  •   Frederik Kammer    10 年前

    看起来openssl有问题。

    rvm在我的安装中使用自制软件作为包管理器(我想这是默认的)。您可以确保 rvm autolibs homebrew .

    我重新安装了 开放ssl 具有

    brew reinstall openssl
    

    和锯通孔 brew list 还有另一个openssl包名为 打开ssl098 安装在我的系统上。尝试重新安装它也会导致以下错误:

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

    我刚拿下包裹

    brew uninstall --force openssl098
    

    并重新安装 开放ssl 再次确认 打开ssl098 不需要依赖。但它没有再次安装。

    之后,我再次尝试通过rvm安装ruby-2.2.4,它运行得很好:)所以我想我的openssl包是因为某种原因而损坏的。

        2
  •  1
  •   medik    10 年前

    openssl098 已经 officially removed 并且不再可用。很可能你有过时的 rvm 它试图建立在 0.9.8 树枝使现代化 右心室肌 修复: rvm get head . Source .

        3
  •  0
  •   S.Yadav    9 年前

    我试图安装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

        4
  •  0
  •   Winstijn Smit    9 年前

    这就是我的工作。我总是忘记这样做。一次性的事情。

    xcode-select --install
    
        5
  •  0
  •   Cris R    6 年前
    brew --prefix openssl # get the path you need for openssl
    
    rvm install "ruby-2.6.4" --with-openssl-dir=PATH_TO_OPENSSL