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