3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

asdfでErlangのインストール時にNo usable OpenSSL found

Last updated at Posted at 2020-05-26

はじめに

asdfでErlangのインストール時に「No usable OpenSSL found」とエラーが出た時の対処方法
ある日 phoenixを最新版にしたくてmix local.phxをするとエラー
はてと思い、mix local.hexもエラー。。。
先日まで何事もなくいごきよったのに。。。

参考

github:asdf-vm/asdf-erlang「No usable OpenSSL found #82」
Special Thanks @nishiuchikazuma

環境

  • macOS Catalina
  • OpenSSL 1.1 Macのデフォルト
  • IEx 1.9.1 (compiled with Erlang/OTP 22)
  • erlang 22.1.5
  • phoenix 1.4.16

このバージョンにしたい。

  • IEx 1.10.1
  • phoenix 1.5.3
  • erlang 22.3.4.1

目次

  • OpenSSLにパスを通そう
  • 「No usable OpenSSL found」のエラー
  • 環境変数:KERL_CONFIGURE_OPTIONSの設定

OpenSSLにパスを通そう

# pathの確認
$ which openssl
/usr/bin/openssl
# ん?どうもパスがおかしい。

# fishの設定ファイルを変更する。
$ cat $HOME/.config/fish/config.fish
function fish_user_key_bindings
  bind \cr 'peco_select_history (commandline -b)'
  # bind \cx\ck peco_kill
  bind \cx\cr peco_recentd
end
# こっから3行追記
source ~/.asdf/asdf.fish
set -g fish_user_paths "/usr/local/opt/openssl@1.1/bin" $fish_user_paths
set -g fish_user_paths "/usr/local/sbin" $fish_user_paths

# pathの確認
$ which openssl
/usr/local/opt/openssl@1.1/bin/openssl

「No usable OpenSSL found」のエラー

asdfでerlangをインストールするとエラーになる。

# erlangのインストール
$ asdf install erlang 22.3.4.1
# こんなエラーがでる。
* crypto         : No usable OpenSSL found
* ssh            : No usable OpenSSL found
* ssl            : No usable OpenSSL found

環境変数:KERL_CONFIGURE_OPTIONSの設定

kerlの環境変数にOpenSSLの場所を指定することでエラーが解消されました。
※OpenSSLはMacに入っていたものを指定してます。(brewでインストールしたものはパスが違うので注意)

# 環境変数の設定
$ export KERL_CONFIGURE_OPTIONS="--disable-debug --disable-silent-rules --without-javac --enable-shared-zlib --enable-dynamic-ssl-lib --enable-hipe --enable-sctp --enable-smp-support --enable-threads --enable-kernel-poll --enable-wx --enable-darwin-64bit --with-ssl=/usr/local/opt/openssl"

# 環境変数の設定(brew版)
export KERL_CONFIGURE_OPTIONS="--disable-debug --disable-silent-rules --without-javac --enable-shared-zlib --enable-dynamic-ssl-lib --enable-hipe --enable-sctp --enable-smp-support --enable-threads --enable-kernel-poll --enable-wx --enable-darwin-64bit --with-ssl=/usr/local/Cellar/openssl/1.0.2t"

$ asdf install erlang 22.3.4.1
# これで無事インストールできました

きっと自分を助ける備忘録になるはず。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?