我按照教程安装了Guardian,使用{:guardian,“〜> 0.14”}。 运行mix deps.get时 它给出了这个错误:
** (Mix.Config.LoadError) could not load config config/dev.exs
** (CompileError) config/dev.exs:1: undefined function mix/1
(elixir) lib/code.ex:176: Code.eval_string/3
(mix) lib/mix/config.ex:180: Mix.Config.read!/2
(mix) lib/mix/config.ex:217: anonymous fn/3 in Mix.Config.read_wildcard!/2
这是我的config / dev.exs文件。我尝试为监护人生成一个秘密密钥,但它给出了明智的问题
mix phoenix.gen.secretuse Mix.Config
config :sling, Sling.Endpoint,
http: [port: 4000],
debug_errors: true,
code_reloader: true,
check_origin: false,
watchers: []
# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n"
# Set a higher stacktrace during development. Avoid configuring such
# in production as building large stacktraces may be expensive.
config :phoenix, :stacktrace_depth, 20
# Configure your database
config :sling, Sling.Repo,
adapter: Ecto.Adapters.Postgres,
username: "postgres",
password: "postgres",
database: "sling_dev",
hostname: "localhost",
pool_size: 10
# Configure Guardian
config :guardian, Guardian
import_config "dev.secret.exs"
答案 0 :(得分:0)
从第1行移除mix phoenix.gen.secret
以便成为use Mix.Config