LoginSignup
9
8

More than 5 years have passed since last update.

mix ecto.createが失敗するとき

Posted at

こうなった時の対処方法。
結論としてはどこかしらのバージョン違いがあると発生するので、足並みを揃えてあげましょうってことになります。
今回はElixirの最新のdev版を入れたため発生。

Unchecked dependencies for environment dev:
* cowboy (Hex package)
  the dependency is not available, run "mix deps.get"
* phoenix_html (Hex package)
  the dependency is not available, run "mix deps.get"
* phoenix (Hex package)
  the dependency is not available, run "mix deps.get"
* phoenix_live_reload (Hex package)
  the dependency is not available, run "mix deps.get"
* postgrex (Hex package)
  the dependency is not available, run "mix deps.get"
* phoenix_ecto (Hex package)
  the dependency is not available, run "mix deps.get"
** (Mix) Can't continue due to errors on dependencies

言うとおりにmix deps.get を叩いてみる

$ mix deps.get
Running dependency resolution
** (UndefinedFunctionError) undefined function: Access.Map.get_and_update!/3 (module Access.Map is not available)

モジュールがないらしい。
mixの公式を見てみた。
https://hex.pm/docs/usage

Mix will automatically prompt you whenever there is a need to use Hex. In case you want to manually install or update hex, simply run $ mix local.hex.

こんなことが書いてあったのでmixからHexのアップデートをしてみる

$ mix local.hex
Found existing archive(s): hex.ez.
Are you sure you want to replace them? [Yn] y
* creating /home/user/.mix/archives/hex-0.9.0.ez

これでHexのバージョンが上がったので、もう一回実行してみる

$ mix deps.get
Running dependency resolution
Dependency resolution completed successfully

これで mix ecto.create が通るようになった。
そもそも何かしらのバージョン上げる時は依存性を確認してからやるべきですが、備忘録として残しておきます。

9
8
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
9
8