简体   繁体   English

我如何使用 mix(Elixir) 安装包安装到系统?

[英]how can i using mix(Elixir) install package install to system?

I just want run IEx to require this package, I do not want create a mix project and into the deps.我只想运行 IEx 来需要这个包,我不想创建一个混合项目并进入 deps。

For example, gem install bundle例如, gem install bundle

How do I do this?我该怎么做呢?

As I understood, mix archive.install is useful to install archives that will provide mix tasks.据我了解, mix archive.install对于安装提供混合任务的档案很有用。 What you could do is to put all the .beam files in a repository that will be specified at iex/elixir startup (with the -pa $CUSTOMPATH option).您可以做的是将所有 .beam 文件放在将在 iex/elixir 启动时指定的存储库中(使用-pa $CUSTOMPATH选项)。 This will load the .beam files during elixir startup.这将在 elixir 启动期间加载 .beam 文件。

For instance, in the elixir shell script, there is this line:例如,在elixir shell 脚本中,有这样一行:

exec "$ERL_PATH" -pa "$SCRIPT_PATH"/../lib/*/ebin $ELIXIR_ERL_OPTIONS $ERL -extra "$@"

You can add an additional `-pa ~/.local/ebin" to load those .beam file你可以添加一个额外的`-pa ~/.local/ebin" 来加载那些 .beam 文件

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM