簡體   English   中英

在安裝守護程序后,在elixr守護程序中混合deps.get錯誤

[英]mix deps.get error in elixr guardian after guardian installation

我按照教程使用{:guardian,“〜> 0.14”}安裝了Guardian。 運行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"

從第1行中刪除mix phoenix.gen.secret ,以便use Mix.Config

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM