guide-startedに関連する環境変数を定義しました。私のmix.exsは
defmodule Basic.Mixfile do
use Mix.Project
def project do
[app: :basic,
version: "0.0.1",
elixir: "~> 0.13.0-dev",
deps: deps,
env: [
dev: [foo: "bar"] ] ]
end
# Configuration for the OTP application
#
# Type `mix help compile.app` for more information
def application do
[ applications: [],
mod: { Basic, [] } ]
end
# List all dependencies in the format:
#
# { :foobar, git: "https://github.com/elixir-lang/foobar.git", tag: "0.1" }
#
# Type `mix help deps` for more examples and options
defp deps do
[]
end
end
そして、iex -S mix
orMIX_ENV=dev iex -S mix
でプロジェクトを開始し、 で環境変数を取得したいのですが、 ;:application.get_env(:basic, :foo)
になりました。:undefined
を使用:application.get_all_env(:basic)
して、返された、変数[included_applications: []]
はありません。env
私の質問は、環境値を取得するにはどうすればよいですか?