Elixir 为什么可以';我不能让IEx.pry在窗户上工作吗?
我正在尝试使用以下代码示例使IEx.pry工作:Elixir 为什么可以';我不能让IEx.pry在窗户上工作吗?,elixir,Elixir,我正在尝试使用以下代码示例使IEx.pry工作: require IEx; defmodule Example do def double_sum(x, y) do IEx.pry hard_work(x, y) end end Example.double_sum(1, 2) 当我运行它时,我得到以下错误: Cannot pry #PID<0.106.0> at lib/example.ex:5. Is an IEx shell running? I
require IEx;
defmodule Example do
def double_sum(x, y) do
IEx.pry
hard_work(x, y)
end
end
Example.double_sum(1, 2)
当我运行它时,我得到以下错误:
Cannot pry #PID<0.106.0> at lib/example.ex:5. Is an IEx shell running? If you are Windows, you may need to start IEx with the --werl flag.
(SyntaxError) iex:1: keyword argument must be followed by space after: c:
我收到了以下错误:
Cannot pry #PID<0.106.0> at lib/example.ex:5. Is an IEx shell running? If you are Windows, you may need to start IEx with the --werl flag.
(SyntaxError) iex:1: keyword argument must be followed by space after: c:
假设模块代码位于
“c:/Users/william/Desktop/example.ex”
,则可以输入iex
并从那里强制编译:
iex> c "c:/Users/william/Desktop/example.ex"
Request to pry #PID<0.89.0> at /tmp/a.ex:5
defmodule Example do
def double_sum(x, y) do
IEx.pry
x + y
end
Allow? [Yn] y
Interactive Elixir (1.5.0-dev) - press Ctrl+C to exit (type h() ENTER for help)
pry(1)>
或:
在phoenix应用程序中启用IEx.pry支持
- )李>
旁注:
require IEx
后面的分号是多余的,是一种代码味道。对于最后一个问题,您需要将路径包装成字符串:cd(“c:/Users/william/Desktop/example”)。
。
iex -S mix phoenix.server