hotch-potch, Note to self

いろいろ作業記録

mix local.hexが失敗するときの処置

1.はじめに

mix deps.getを実行すると、mix local.hexの処理でコケました。 (下記の例は、circuits_i2cを使う時の例)

「function :inets.stop/2 is undefined」とのことですが・・・

このときの処置についてメモを残します。

$ mix deps.get
Could not find Hex, which is needed to build dependency :circuits_i2c
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn]
** (UndefinedFunctionError) function :inets.stop/2 is undefined (module :inets is not available)
    :inets.stop(:httpc, :mix)
    (mix) lib/mix/utils.ex:560: Mix.Utils.read_httpc/1
    (mix) lib/mix/utils.ex:501: Mix.Utils.read_path/2
    (mix) lib/mix/local.ex:149: Mix.Local.read_path!/2
    (mix) lib/mix/local.ex:126: Mix.Local.find_matching_versions_from_signed_csv!/2
    (mix) lib/mix/tasks/local.hex.ex:56: Mix.Tasks.Local.Hex.run_install/1
    (mix) lib/mix/dep/loader.ex:168: Mix.Dep.Loader.with_scm_and_app/4
    (mix) lib/mix/dep/loader.ex:121: Mix.Dep.Loader.to_dep/3

2.状況

  • OS
    • Raspbian Buster
    • バージョン
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
  • Elixirのインストール方法
    • Raspbian の標準パッケージを使用
      • $ sudo apt install elixir
    • バージョン
$ elixir -v
Erlang/OTP 21 [erts-10.2.4] [source] [smp:4:4] [ds:4:4:10] [async-threads:1]

Elixir 1.7.4 (compiled with Erlang/OTP 21)

3.処置

undefinedになっている関数を含んでいるパッケージ、erlang-inetsをインストールします。

$ sudo apt install erlang-inets
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  erlang-asn1 erlang-ftp erlang-mnesia erlang-public-key erlang-runtime-tools erlang-ssl
  erlang-tftp
Suggested packages:
  erlang erlang-manpages erlang-doc
The following NEW packages will be installed:
  erlang-asn1 erlang-ftp erlang-inets erlang-mnesia erlang-public-key erlang-runtime-tools
  erlang-ssl erlang-tftp
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,053 kB of archives.
After this operation, 5,855 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

mix deps.getが通りました。

$ mix deps.get
Could not find Hex, which is needed to build dependency :circuits_i2c
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] y
* creating /home/pi/.mix/archives/hex-0.20.5
Resolving Hex dependencies...
Dependency resolution completed:
New:
  circuits_i2c 0.3.6
  elixir_make 0.6.0
* Getting circuits_i2c (Hex package)
* Getting elixir_make (Hex package)

4.参考資料