Elixir& Phoenix:将memcache_client库添加到app

时间:2017-02-07 10:16:08

标签: memcached elixir phoenix-framework

我想在我的Phoenix App中使用这个库连接到Memcache:https://github.com/tsharju/memcache_client

当我运行我的服务器时,我收到此错误:

** (exit) exited in: :gen_server.call(Memcache.Client.Pool, {:checkout, #Reference<0.0.1.768>, true}, 5000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
              :erlang.send(Memcache.Client.Pool, {:"$gen_cast", {:cancel_waiting, #Reference<0.0.1.768>}}, [:noconnect])

我知道有一位医生说:

  

另外,请记住将:memcache_client添加到:applications列表中   您希望应用程序自动启动。

但我不明白我应该在凤凰应用中做些什么。有帮助吗?谢谢!

2 个答案:

答案 0 :(得分:3)

buildAngular中,将mix.exs添加到函数:memcache_client中的密钥:applications

application/0

- &GT;

def application do
  [mod: {MyApp, []},
   applications: [:phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext,
                  :phoenix_ecto, :postgrex]]
end

答案 1 :(得分:0)

解决了它。只需编辑mix.exs文件即可。有一个返回应用程序列表的方法应用程序:

--jar

相关问题