由于 erlang 依赖 wxGTK 等相关基础图形库,后者是维护在 epel 仓库里,所以首先需要安装 epel 软件仓库
添加 epel 软件仓库
| 
 | 
安装需要用到的小工具
| 
 | 
安装 erlang
| 
 | 
安装 elixir
注意:由于版本过度,请不要从 CentOS 的中央仓库安装 elixir
| 
 | 
最后确认下 mix 的版本:mix --version
在笔者写作这篇文章时的输出:Erlang/OTP 19 [erts-8.2] [source-fbd2db2] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]Mix 1.4.0-rc.1 (16a14c1)
安装 hex, postgresql-9.6 及 phoenix app
postgresql 是 phoenix 默认的数据库,若需要的话,遵循如下方式安装最新的 9.6 版本:
- 添加 postgresql 软件源 yum localinstall https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
- 安装 postgresql-9.6 yum install postgresql96
- 初始化数据库 /usr/pgsql-9.6/bin/postgresql96-setup initdb
- 启动数据库服务 systemctl start postgresql-9.6.service
- 添加为系统自启动服务 systemctl enable postgresql-9.6.service
- 为支持 live code reload 安装下 nodejs, inotify-tools yum install inotify-toolsyum install nodejs
- 安装 hex 及 phoenix app 框架 mix local.hexmix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez
- [可选] 安装 vim elixir 语法高亮插件 
 需要 Vundle 支持vim ~/.vimrc添加:Plugin 'elixir-lang/vim-elixir'