我在Windows上,正在尝试安装bcrypt_elixir模块。
我得到以下错误:
$ mix phx.server
==> bcrypt_elixir
could not compile dependency :bcrypt_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile bcrypt_elixir", update it with "mix deps.update bcrypt_elixir" or clean
我正在开发一个在Docker容器中使用Phoenix框架的web应用程序。以下是dockerfile中关于phoenix安装方式的相关行:
RUN git clone https://github.com/phoenixframework/phoenix
RUN cd /home/user/phoenix/installer/ && MIX_ENV=prod mix do archive.build, archive.install --force
这一切都很好。我可以使用以下命令生成一个新的phoenix项目:
mix phx.new hello_phoenix
但是,当我使
我在Heroku中部署了我的应用程序,但尽管部署正常,但在浏览器显示视图中:
错误的唯一线索在应用程序的日志中:
: State changed from crashed to starting
2017-03-31T020 heroku[web.1]: Process exited with status 1
1]: Starting process with command `MIX_ENV=prod mix phoenix.server`
=INFO REPORT==== 31-Mar-2017::02:20:04 ===
application: boom_
我正在尝试将argon2_elixir添加到我的菲尼克斯项目中,但编译时会出现以下错误:
mix compile
==> argon2_elixir
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
makefile(34) : fatal error U1000: syntax error : ')' missing in macro invocation
Stop.
co
我正在学习Phoenix (和Elixir),在阅读了一些文档后,我注意到在模板中呈现HTML的方式之间存在一些冲突。我不知道使用哪种方法更好。
以phoenix 中的代码示例为例
<%= for key <- connection_keys(@conn) do %>
<p><%= key %></p>
<% end %>
上面的代码在新段落中打印每个连接键。为什么不这样做呢?
<%= for key <- connection_keys(@conn) do
content_tag :p, k
我在我的凤凰应用程序中创建了一个名为ProgressController的控制器。这就是我的路由器文件的样子:
defmodule MyTestApp.Router do
use MyTestApp.Web, :router
pipeline :api do
plug :accepts, ["json"]
end
scope "/", MyTestApp do
pipe_through :api
get "/users/:user_id/courses/:course_id", ProgressCon
我正在使用Phoenix Framework将Rails中编写的API重写为Elixir。
主网站使用Rails,并将继续使用Rails。但是,我希望API使用Elixir。
我需要能够从我的Elixir API项目中读取created_at字段。
defmodule Example.Recipe do
use Ecto.Schema
schema "recipes" do
field :name, :string
field :description, :string
field :slug, :string
field :creat
我正在尝试使用cachex作为我的phoenix/elixir web应用程序的缓存层。当我打开交互式控制台iex,并输入Cachex.get(:my_cache, "key") 它显示了 (UndefinedFunctionError) function Cachex.get/2 is undefined (module Cachex is not available) 我遵循了这里所示的所有步骤,https://github.com/whitfin/cachex
我正在使用Comeonin的5.1.2版本来散列密码。表示,bcrypt_elixir或argon2都是兼容的散列库。我遇到的问题就发生在这两个方面。
如果我按照docs的建议尝试使用Argon2.hash_pwd_salt,则会得到以下错误:
** (UndefinedFunctionError) function Comeonin.Argon2.hash_pwd_salt/1 is undefined or private. Did you mean one of:
* hashpwsalt/1
* hashpwsalt/2
但是,如果我跟踪错误并使用Argon2.hashpws
偶尔,当我在我的药方代码中输入一个错误并且出现一个CompileError时,菲尼克斯即使在我修复了所有东西之后也拒绝重新加载,并且继续打印App.Endpoint.path/1 is undefined (App是我的应用程序)。当然,端点被定义得非常好,并且在我重新启动mix phoenix.server时再次工作。
据我所知,我是最新版本的每样东西。因为我在网上找不到关于这个错误的任何东西,所以我怀疑我错了一些东西,我很感激你关于如何找到这个错误的根源的建议。
[info] Sent 200 in 200ms
iex[debug] Live reload: web/resolver/re
我想知道如何在我的phoenix模板中使用javascript函数动态更新Phoenix变量。
目前,我有一个从我的控制器发送的列表,我正在使用一个elixir for循环来根据它内部的内容来呈现html。我希望能够在输入框中键入内容,并根据输入框中的内容过滤列表。
代码示例
<%= for word <- @words do %>
<p><%= word %></p>
<% end %>
我希望能够动态过滤基于js函数的@words。
有谁知道如何实现这一点吗?
提前感谢
我对elixir和phoenix (以及ubuntu)非常陌生,并且一直在努力让自己开始并运行web开发。在使用以下命令创建新phoenix应用程序时
mix phoenix.new webapp
我从终端得到以下错误
Fetch and install dependencies? [Yn] y
* running mix deps.get
* error command failed to execute, please run the following command again after installation: "mix deps.get"
* running n
我正在尝试转换数据库的新环境。 我执行了phx.gen.json,然后创建了相关的模型。数据库中已有表。我想我不需要ecto migration来做数据库。 然而,当我访问json url path时,我遇到了以下错误。它似乎在数据库和获取数据方面取得了成功。因为我看到QUERY OK了。 ** (exit) an exception was raised:
** (Protocol.UndefinedError) protocol Enumerable not implemented for nil of type Atom. This protocol is implemente