简体   繁体   English

使用“mix deps.get”安装后无法在 elixir shell 中运行 function

[英]Can't run function in elixir shell after installing with `mix deps.get`

I am trying to install mint with hex as directed in the README.我正在尝试按照自述文件中的说明使用hex安装mint However when I try to execute the example code I get an error:但是,当我尝试执行示例代码时,出现错误:

9afa01708fef# iex  
Erlang/OTP 22 [erts-10.5] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]

Interactive Elixir (1.9.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> {:ok, conn} = Mint.HTTP.connect(:http, "httpbin.org", 80)
** (UndefinedFunctionError) function Mint.HTTP.connect/3 is undefined (module Mint.HTTP is not available)
    Mint.HTTP.connect(:http, "httpbin.org", 80)

What have I missed here?我在这里错过了什么?

Silly me.傻我。 The solution was to start the shell with:解决方案是使用以下命令启动 shell:

iex -S mix

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Elixir:mix deps.get 请求失败(403)并且没有缓存副本 - Elixir: mix deps.get Request failed (403) and no cached copy 编写一个在deps.get之后运行的Mix任务 - Write a Mix task that runs after deps.get 在安装守护程序后,在elixr守护程序中混合deps.get错误 - mix deps.get error in elixr guardian after guardian installation mix deps.get失败(依赖问题) - mix deps.get fails (dependency issue) 如果Deps是最新的,请阻止使用deps.get混合网络? - Prevent mix deps.get using the network if the deps are up to date? mix deps.get失败(似乎缺少ssl?) - mix deps.get failed (seems missing ssl?) 运行mix deps.get引发:erlang.binary_to_atom参数错误 - Running mix deps.get throws :erlang.binary_to_atom argument error 长生不老药-不能在两次下降之间进行Record.extract - Elixir - Can't get to Record.extract between 2 Deps mix deps.get 失败,{:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], {:option, :server_only, :honor_cipher_order}}]} - mix deps.get fails, {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], {:option, :server_only, :honor_cipher_order}}]} 用外部.ex文件编写的Elixir匿名函数无法与交互式shell一起运行 - Elixir's anonymous function written in external .ex file can't run with interactive shell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM