🧬
cargo-binstallでdioxus-cliをインストールした際に出るOpenSSLエラーの解決方法
この記事でわかること
- 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
コマンドの実行する。
実行したこと
- cargo-binstall をbrewでインストール。
- dioxus-cli を cargo-binstall で インストール。
- 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)
無事実行できました!
参考文献
-
Dioxus | Fullstack crossplatform app framework for Rust
- 2025/02/23 最終閲覧。
If you get an OpenSSL error on installation, ensure the dependencies listed here are installed.
-
openssl - Rust
- 2025/02/23 最終閲覧。
# macOS (Homebrew)
$ brew install openssl@3
Discussion