怎么称呼:mixmail在Elixir?

时间:2016-03-14 09:15:07

标签: elixir phoenix-framework

antp/mailermailer/smtp_client.ex中调用:mimemail.encode。如果它在mix phoenix.server内运行,它可以正常工作,但它无法在发布环境(使用mix release构建)中调用它。它因以下错误而崩溃:

(UndefinedFunctionError) undefined function :mimemail.encode/1 (module :mimemail is not available)

是否有任何配置可以在exrm环境中调用它,或者错过要配置的内容?

[更新] 我的mix.exs中的applicationdeps位于以下位置:

 def application do
    [mod: {NeoSmslife, []},
     applications: [:phoenix, :phoenix_html, :cowboy, :logger, :gettext,
                    :phoenix_ecto, :mariaex,
                    :logger_file_backend,
                    :tzdata,
                    :ueberauth,
                    :ueberauth_facebook,
                    :ueberauth_twitter,
                    :timex,
                    :guardian,
                    :mailer,
                    :secure_random
                  ]]
  end

 defp deps do
    [{:phoenix, "~> 1.1.2"},
     {:phoenix_ecto, "~> 2.0"},
     {:mariaex, ">= 0.0.0"},
     {:phoenix_html, "~> 2.3"},
     {:phoenix_live_reload, "~> 1.0", only: :dev},
     {:gettext, "~> 0.9"},
     {:cowboy, "~> 1.0"},
     {:logger_file_backend , "~> 0.0.5"},
     {:secure_random, "~> 0.2"},
     {:mailer, github: "antp/mailer"},
     {:guardian, "~> 0.9.0"},
     {:guardian_db, "0.4.0"},
     {:ueberauth, "~> 0.2"},
     {:ueberauth_facebook, "~> 0.3.2"},
     {:oauth, github: "tim/erlang-oauth"},
     {:ueberauth_twitter, "~> 0.2"},
     {:timex, "~> 1.0.1"},
     {:mix_test_watch, "~> 0.2", only: :dev},
     {:exrm, "~> 1.0.2"}

   ]
  end

1 个答案:

答案 0 :(得分:1)

尝试将gen_smtp添加到依赖项和应用程序列表中。我不确定为什么没有对非发布版本的依赖就可以工作;我的意思是我相信你应该在没有指定gen_smtp的情况下得到那个错误。