Closed1
Lubuntu24+brew+mise+rubyでOpenSSL is not available

環境
- Lbuntu24.02
- brew
- mise
- ruby 3.4.3
エラー
OpenSSLを認識できないと言われた。
$ gem install commonmarker
ERROR: While executing gem ... (Gem::Exception)
OpenSSL is not available. Install OpenSSL and rebuild Ruby or use non-HTTPS sources (Gem::Exception)
対応
brewのOpenSSL確認。OpenSSL3.5.0がインストールされてる。
$ brew info openssl@3
==> openssl@3: stable 3.5.0 (bottled)
Cryptography and SSL/TLS Toolkit
https://openssl-library.org
Installed
rubyでOpenSSLのバージョン確認。brewのOpenSSLを使ってない。
$ ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
<internal:/home/blue21/.local/share/mise/installs/ruby/3.4.3/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require': /lib/x86_64-linux-gnu/libcrypto.so.3: version `OPENSSL_3.4.0' not found (required by /home/blue21/.local/share/mise/installs/ruby/3.4.3/lib/ruby/3.4.0/x86_64-linux/openssl.so) - /home/blue21/.local/share/mise/installs/ruby/3.4.3/lib/ruby/3.4.0/x86_64-linux/openssl.so (LoadError)
brewのOpenSSLを使用するようにして、rubyを再インストールする。
$ mise uninstall ruby@3.4.3
$ export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@3)"
$ mise install ruby@3.4.3
OpenSSLを認識したか確認。バージョンが表示されたのでOK
$ ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
OpenSSL 3.5.0 8 Apr 2025
インストールできました。
$ gem install commonmarker
Fetching commonmarker-2.3.0-x86_64-linux.gem
Successfully installed commonmarker-2.3.0-x86_64-linux
1 gem installed
このスクラップは4ヶ月前にクローズされました