博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Elixir 初尝试 0 --环境安装
阅读量:6973 次
发布时间:2019-06-27

本文共 3167 字,大约阅读时间需要 10 分钟。

这一篇是从我自己的笔记里面搬出来的,所以有些描述会过于简洁。

Elixir开始耍

最近无聊,逛ruby社区,发现一个词貌似很火(原谅我最近没读书看报),好奇心又蹦出来了,就开始了学习elixir的道路。

安装elixir

安装只需一行命令

brew install elixir
但是实际安装的东西仔细观察,会发现大概包含相关依赖jpeg, libtiff, wxmac, erlang
具体每个做什么的 请自行参考维基百科。

➜  ~ brew install elixir==> Installing dependencies for elixir: jpeg, libtiff, wxmac, erlang==> Installing elixir dependency: jpeg==> Downloading https://homebrew.bintray.com/bottles/jpeg-8d.el_capitan.bottle.2.tar.gz######################################################################## 100.0%==> Pouring jpeg-8d.el_capitan.bottle.2.tar.gz?  /usr/local/Cellar/jpeg/8d: 19 files, 713.7K==> Installing elixir dependency: libtiff==> Downloading https://homebrew.bintray.com/bottles/libtiff-4.0.6_1.el_capitan.bottle.tar.gz######################################################################## 100.0%==> Pouring libtiff-4.0.6_1.el_capitan.bottle.tar.gz?  /usr/local/Cellar/libtiff/4.0.6_1: 261 files, 3.4M==> Installing elixir dependency: wxmac==> Downloading https://homebrew.bintray.com/bottles/wxmac-3.0.2_2.el_capitan.bottle.tar.gz######################################################################## 100.0%==> Pouring wxmac-3.0.2_2.el_capitan.bottle.tar.gz?  /usr/local/Cellar/wxmac/3.0.2_2: 809 files, 23.7M==> Installing elixir dependency: erlang==> Downloading https://homebrew.bintray.com/bottles/erlang-18.3.el_capitan.bottle.2.tar.gz######################################################################## 100.0%==> Pouring erlang-18.3.el_capitan.bottle.2.tar.gz==> CaveatsMan pages can be found in:  /usr/local/opt/erlang/lib/erlang/man Access them with `erl -man`, or add this directory to MANPATH.==> Summary?  /usr/local/Cellar/erlang/18.3: 7,388 files, 272.9M==> Installing elixir==> Downloading https://homebrew.bintray.com/bottles/elixir-1.3.1.el_capitan.bottle.tar.gz ######################################################################## 100.0%==> Pouring elixir-1.3.1.el_capitan.bottle.tar.gz?  /usr/local/Cellar/elixir/1.3.1: 383 files, 5M

hello world 之旅

第二步是开始一个“hello world”之旅

但听说elixir的一个框架还不错,名字也很厉害叫做phoenix,决定写个简单的API 来返回“hello world”吧
然后又开始安装的道路。

官网介绍先需要利用mix命令(安装完Elixir就会自动get到的一个命令)安装Hex,Hex是个什么东东,官网的介绍是The package manager for the Erlang ecosystem,简单来说就是Erlang生态圈的包管理器,基本上就是npm之于node,gem之于ruby。

➜  ~  mix local.hexAre you sure you want to install archive "https://repo.hex.pm/installs/1.3.0/hex-0.14.1.ez"? [Yn] y* creating .mix/archives/hex-0.14.1

Phoenix

这样还不能开始,检查下 Elixir and Erlang是不是都有了,就开始安装凤凰侠吧!

➜  ~ mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ezAre you sure you want to install archive "https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez"? [Yn] y* creating .mix/archives/phoenix_new

如果安装失败,就去官网下个包放在文件系统,然后run下命令

mix archive.install /path/to/local/phoenix_new.ez

应该也是可以滴,人家官网如是说:

Note: if the Phoenix archive won't install properly with this command, we can download the package from the Phoenix archives, save it to the filesystem, and then run: mix archive.install /path/to/local/phoenix_new.ez.

这个命令同样也是一个命令安装了很多的默认包如Plug, Cowboy, and Ecto,

另外如果需要使用 brunch.io来编译一些静态部分,需要用npm,npm默认需要node。

最后关于elixir这个语言的一些框架 第三方可用组件信息在github也有前人做了收集,叫做.

转载地址:http://sirsl.baihongyu.com/

你可能感兴趣的文章
svn本地文件夹断开服务器连接
查看>>
应用级缓存
查看>>
C/C++结构体定义
查看>>
为什么前后端分离了,你比从前更痛苦?
查看>>
云软件——艺术字符设计!【推荐】
查看>>
[转载]webarchive文件转换成htm文件
查看>>
Oracle 用户(user)和模式(schema)的区别
查看>>
Android无需权限显示悬浮窗, 兼谈逆向分析app
查看>>
恢度发布-上线前的最后一公里
查看>>
站在巨人的肩上,浅谈智能手机 app 开发
查看>>
volley JsonObjectRequest post请求
查看>>
北京八达岭野生动物园伤人事件
查看>>
illegal interface qualifier
查看>>
忒开心了,又认识一老爷子
查看>>
RubySpec 重生:破蛹成蝶
查看>>
seci-log 1.07 发布 增加资产发现和远程日志分析
查看>>
Helpful tips: Monitor DNS events
查看>>
数人云|关于Docker Swarm&K8S,几大要素免踩坑
查看>>
jtable 隐藏列 显示表头
查看>>
spring mvc 框架学习文档
查看>>