🧬

cargo-binstallでdioxus-cliをインストールした際に出るOpenSSLエラーの解決方法

2025/02/23に公開

この記事でわかること

  • cargo-binstallでインストールされたdioxus-cliコマンドを実行時、下記のようなエラーが出た場合の解決方法がわかります。
dyld[5030]: Library not loaded: /opt/homebrew/opt/openssl@3/lib/libssl.3.dylib
  Referenced from: #####
  /Users/ユーザー名/.cargo/bin/dx
  Reason: tried: '/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib' (no such file), '/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib' (no such file)
zsh: abort      dx --version
  • 結論、原因はOpenSSLのライブラリをロードしようとしたが見つからないためでした。
  • openssl - Rust を参考に、OpenSSLをインストールして解決できました。

やろうとしたこと

  • dioxus-cli を cargo-binstall を使ってインストールする。
  • cargo-binstall でインストールされたdioxus-cliでdxコマンドの実行する。

実行したこと

  1. cargo-binstall をbrewでインストール。
  2. dioxus-cli を cargo-binstall で インストール。
  3. dioxus-cli が正常にインストールされたかを dx --version を実行しようとしたところエラーが発生しました。

実行したコマンド

dx --version

発生したエラー

dyld[5030]: Library not loaded: /opt/homebrew/opt/openssl@3/lib/libssl.3.dylib
  Referenced from: #####
  /Users/ユーザー名/.cargo/bin/dx
  Reason: tried: '/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib' (no such file), '/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib' (no such file)
zsh: abort      dx --version

結論

opensslがないために発生しているエラーでした。
brew で openssl をインストールしたところ解決しました。

Library not loaded:

ライブラリをロードしようとしたがなかった

Reason: tried: '/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib' (no such file),

openssl@3のファイルがなかった

解決方法: OpenSSLをbrewでインストール

brew install openssl@3

インストール完了後、dx --versionを実行してみます。

dx --version
dioxus 0.6.3 (fc1f1c2)

無事実行できました!

参考文献

If you get an OpenSSL error on installation, ensure the dependencies listed here are installed.

# macOS (Homebrew)
$ brew install openssl@3

Discussion