OpenSSL error installing ruby 2.0.0-p195 on Mac with rbenv

后端 未结 7 1261
别那么骄傲
别那么骄傲 2021-02-04 06:05

I\'m trying to install Ruby 2.0.0-p195 using rbenv on a Mac (Mountain Lion) and got this error.

BUILD FAILED

Inspect or clean up the working tree at /var/folde         


        
相关标签:
7条回答
  • 2021-02-04 06:46

    Solution using ruby-install:

    After uninstalling and installing openssl a couple of times (probably unnecessary) I successfully tried this:

    ruby-install ruby 2.1.3 -- --with-openssl-dir=`brew --prefix openssl`
    
    0 讨论(0)
  • 2021-02-04 06:48

    Try adding OpenSSL to the config options using the --with-openssl-dir option:

    $ CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`" rbenv install 2.0.0-p195
    

    If you're using Homebrew, you'll need to install OpenSSL before running the above by running:

    $ brew install openssl
    

    UPDATE (see @JarkkoLaine 's comment below):

    Just for the record, you should not need to use the config opts anymore with ruby-build and homebrew. However, I had to reinstall openssl with homebrew to make it work: brew uninstall openssl; brew upgrade; brew install openssl; rbenv install 2.0.0-p247. See this for more info.

    0 讨论(0)
  • 2021-02-04 06:54

    I fixed this by executing:

    brew link openssl --force
    

    Mac OSX 10.9.4

    0 讨论(0)
  • 2021-02-04 07:00

    The missing library is libssl*-dev* / openssl*-dev*, depending your distribution.

    0 讨论(0)
  • 2021-02-04 07:05

    Upgrading to the latest version of ruby-build fixed the problem for me:

    Like the OP, I got

    BUILD FAILED
    
    Inspect or clean up the working tree at /Users/me/.rbenv/sources/2.0.0-p247
    Results logged to /var/folders/3x/y_8y8vr53ws_kxj97km79q5h0000gn/T/ruby-build.20130704172404.3106.log
    
    Last 10 log lines:
    installing default gems:      /Users/me/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0 (build_info, cache, doc, gems, specifications)
                                  bigdecimal 1.2.0
                                  io-console 0.4.2
                                  json 1.7.7
                                  minitest 4.3.2
                                  psych 2.0.0
                                  rake 0.9.6
                                  rdoc 4.0.0
                                  test-unit 2.0.0.0
    The Ruby openssl extension was not compiled. Missing the OpenSSL lib?
    

    but installing the latest version of ruby-build, via

    # Don't forget brew doctor and brew update if required
    brew upgrade ruby-build
    

    fixed it.

    Ruby-build had some changes between when the OP asked and now, which would explain why it worked for me, but not for the OP using the latest stable version of ruby-build.

    0 讨论(0)
  • 2021-02-04 07:07

    This issue came up again for me with Mac OS 10.9.5

    Mac upgraded the command-line tools and that upgraded openssl, which broken rbenv.

    I tried all of these solutions, but none of them worked. Everything was up-to-date, but I couldn't install any new gems or build rubies.

    My solution was to:

    1. Remove the ruby version (for me it was 2.1.1)
    2. Brew uninstall ruby-build and rbenv
    3. Brew Re-install rbenv and ruby-build

    Hope this helps you if you encounter it too!

    0 讨论(0)
提交回复
热议问题