mac下asdf安装erlang,elixir

不知什么时候把erlang OTP 和elixir的版本升上去了,和服务器环境不一样了,然后苦逼的事情就开始了,重新安装erlang 和elixir,让其版本和服务器一样。

In this episode we’ll look at one way to install Elixir.

I’ve been using the version manager asdf to handle different versions of Elixir. What’s nice about asdf is that it easily lets you manage different versions of multiple programming languages, like Node and Ruby.

Here are the more comprehensive install instructions, but let’s take a look at how we can install and use it. I’ll copy the URL to download it. And since I’m on a Mac, I’ll be following the instructions for MacOS in the Readme. We’ll clone asdf and add it to the .bash_profile.

1.安装asdf
mac: 直接用brew,会自动下载依赖
brew install asdf
2.
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.5.1

3.配置环境变量(很重要,很重要,很重要,重要的事情说3遍)
mac系统:

echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bash_profile
$ echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile

4、安装elixir

//安装插件
asdf plugin-add elixir
//安装具体版本的elixi
asdf install elixir 1.6.5
//设置包的局部版本
asdf local elixir 1.6.5
//查看
asdf list elixir
//执行elixir -v, 通常会说 erl: not found, 正常情况,需要安装erlang了
elixir -v

5、安装erlang

asdf plugin-add erlang

asdf install erlang 20.3
asdf global erlang 20.3
//测试安装结果
erl

7:参考:
https://elixircasts.io/installing-elixir-with-asdf
https://github.com/asdf-vm/asdf

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值