LoginSignup
5
2

More than 3 years have passed since last update.

nervers.infoによるNervesプロジェクトの確認

Posted at

Nervesのプロジェクトを複数作っていると、どのバージョンのNervesで作成したのかわからなくなる場合がある。
その場合、確認したいNervesプロジェクトのディレクトリ上で、mix nerves.infoコマンドを実行すると良い。

nerves.infoの説明

mix helpコマンドを実行して、nerves.infoの説明を見ると以下のように書いてある。

mix nerves.info            # Prints Nerves information

実にシンプル。

nerves.infoの実行

確認したいNervesプロジェクトのmix.exsがあるディレクトリへ移動する。
移動後、mix help nerves.infoコマンドを実行すると、以下のような情報が出てくる。

                                mix nerves.info

Prints Nerves system information.

    mix nerves.info

Location: _build/dev/lib/nerves/ebin

続いて、Nervesプロジェクトに対してmix nerves.infoコマンドを実行する。
環境によって出力される内容は異なるが、出力の最後にNervesのバージョンNerves BootstrapのバージョンElixirのバージョンが出力されている。

|nerves_bootstrap| Environment Package List

  Pkg:         nerves_system_br
  Vsn:         1.10.0
  Type:        system_platform
  BuildRunner: {nil, []}

  Pkg:         nerves_system_rpi0
  Vsn:         1.10.0
  Type:        system
  BuildRunner: {Nerves.Artifact.BuildRunners.Docker, []}

  Pkg:         nerves_toolchain_armv6_rpi_linux_gnueabi
  Vsn:         1.2.0
  Type:        toolchain
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

  Pkg:         nerves_toolchain_ctng
  Vsn:         1.6.0
  Type:        toolchain_platform
  BuildRunner: {nil, []}

|nerves_bootstrap| Loadpaths Start


Nerves environment
  MIX_TARGET:   rpi0
  MIX_ENV:      dev

|nerves_bootstrap| Env Start

|nerves_bootstrap| Env End

|nerves_bootstrap| Environment Variable List
  target:     rpi0
  toolchain:  /path/to/.nerves/path/to/nerves_gpio_sample/nerves_gpio_sample/deps/nerves/artifacts/nerves_toolchain_armv6_rpi_linux_gnueabi-darwin_x86_64-1.2.0
  system:     /path/to/.nerves/path/to/nerves_gpio_sample/nerves_gpio_sample/deps/nerves/artifacts/nerves_system_rpi0-portable-1.10.0
  app:        /path/to/nerves_gpio_sample/nerves_gpio_sample

|nerves_bootstrap| Loadpaths End

Nerves:           1.5.3
Nerves Bootstrap: 1.6.2
Elixir:           1.9.0
|nerves_bootstrap| Info End

ただし、Nervesプロジェクトのディレクトリ配下でも、mix.exsがあるディレクトリ以外では以下のようなメッセージが出る。

** (Mix) The task "nerves.info" could not be found. Did you mean "nerves.new"?

また、作ったばかりのNervesプロジェクトでmix deps.getコマンドを実施していない場合は、以下のようなエラーメッセージが出てくる。

$mix nerves.info
Unchecked dependencies for environment dev:
* nerves (Hex package)
  the dependency is not available, run "mix deps.get"
* toolshed (Hex package)
  the dependency is not available, run "mix deps.get"
* ring_logger (Hex package)
  the dependency is not available, run "mix deps.get"
* shoehorn (Hex package)
  the dependency is not available, run "mix deps.get"
** (Mix) Can't continue due to errors on dependencies

この場合、メッセージ通りmix deps.getコマンドを実施してやれば良い。

|nerves_bootstrap| Environment Package List

  No packages found
|nerves_bootstrap| Loadpaths Start


Nerves environment
  MIX_TARGET:   host
  MIX_ENV:      dev

|nerves_bootstrap| Env Start

|nerves_bootstrap| Env End

NERVES_SYSTEM is unset
NERVES_TOOLCHAIN is unset
|nerves_bootstrap| Environment Variable List
  target:     host
  toolchain:  unset
  system:     unset
  app:        /path/to/nerves_info_check

|nerves_bootstrap| Loadpaths End

Nerves:           1.5.3
Nerves Bootstrap: 1.6.2
Elixir:           1.9.0
|nerves_bootstrap| Info End
5
2
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
5
2