postmodern / chruby

Changes the current Ruby
MIT License
2.85k stars 190 forks source link

Unable to install on macOS 12.6.7 #495

Closed xta closed 11 months ago

xta commented 11 months ago

Description

Ran this command ruby-install 2.4.6 -- --with-openssl-dir=$(brew --prefix openssl@3)

Getting the follow errors:

ossl_pkey.c:101:26: error: incomplete definition of type 'struct evp_pkey_st'
    if (!pkey || (type = EVP_PKEY_base_id(pkey)) == EVP_PKEY_NONE)
                         ^~~~~~~~~~~~~~~~~~~~~~

ossl_pkey.c:199:13: error: incomplete definition of type 'struct evp_pkey_st'
    switch (EVP_PKEY_base_id(pkey)) {
            ^~~~~~~~~~~~~~~~~~~~~~

6 warnings and 2 errors generated.
make[2]: *** [ossl_pkey.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2
!!! Compiling ruby 2.4.6 failed!

Steps To Reproduce

Steps to reproduce the bug:

  1. ruby-install 2.4.6 -- --with-openssl-dir=$(brew --prefix openssl@3)

Expected Behavior

Ruby 2.4.6 is installed

Actual Behavior

6 warnings and 2 errors generated.
make[2]: *** [ossl_pkey.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2
!!! Compiling ruby 2.4.6 failed!

Environment

$ bash --version
    GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin21)
$ zsh --version
    zsh 5.8.1 (x86_64-apple-darwin21.0)
$ chruby --version
    chruby: 0.3.9
$ ruby --version
    ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin21]
$ gem --version
    3.0.3.1
$ gem env
RubyGems Environment:

  - RUBYGEMS VERSION: 3.0.3.1
  - RUBY VERSION: 2.6.10 (2022-04-12 patchlevel 210) [universal.x86_64-darwin21]
  - INSTALLATION DIRECTORY: /Users/my_username/.gem
  - USER INSTALLATION DIRECTORY: /Users/my_username/.gem/ruby/2.6.0
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
  - GIT EXECUTABLE: /usr/local/bin/git
  - EXECUTABLE DIRECTORY: /Users/my_username/.gem/bin
  - SPEC CACHE DIRECTORY: /Users/my_username/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-21
  - GEM PATHS:
     - /Users/my_username/.gem
     - /Users/my_username/.gem/ruby/2.6.0
     - /Library/Ruby/Gems/2.6.0
     - /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/my_username/.pyenv/shims
     - /Users/my_username/.gem/bin
     - /usr/local
     - /usr/local/bin
     - /usr/local/sbin
     - /usr/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /usr/local/go/bin
     - /Library/Apple/usr/bin
     - /Applications/Wireshark.app/Contents/MacOS
     - /Users/my_username/.rvm/bin
monfresh commented 11 months ago

Ruby versions older than 3.1 do not work with OpenSSL 3. For Ruby versions from 2.4 to 3.0.6, you need to use OpenSSL 1.1.

xta commented 11 months ago

@monfresh thanks, this was helpful!