[HOW TO] install erlang, elixir on CentOS 6

Roughly 30 minutes ago I installed Erlang & Elixir into our server. It doesn't matter for everyone but until when everyone need help lolz.

So I write down the shortly instruction below. 

I. What is erlang & elixir? 
Please google to know it.

II. How to install?
Please ensure wget already installed on your server. The next commands retrieve a package that adds a new repository to CentOS's repository.
[@ ~]# wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
[@ ~]## rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
[@ ~]# yum search erlang
[@ ~]# yum install -y erlang.x86_64 
[@ ~]# erl --versionErlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]Eshell V9.0  (abort with ^G)1> 
Well done, you have already installed erlang.

Next you need to download elixir. In this article, I use elixir 1.4.2 and you can download at here . Also you can download from elixir github officially follows:

If you download source code elixir, you don't have to compile. If you download binary on github, you have to install as below:
[@ ~]# git clone https://github.com/elixir-lang/elixir.git
[@ ~]# make clean test
Now, you have to add Elixir's bin path to your PATH environment variable. Otherwise, Elixir will not work. To do so, you open .bash_profile
[teamcity@s04 ~]$ vim ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
export ELIXIR_HOME=/opt/elixir
export PATH=$PATH:$ELIXIR_HOME/bin
To verify Elixir is work or not, run:
[teamcity@s04 ~]$ iex
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir (1.4.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 
If you see as above, elixir works. Cheer!

III. If you want to install the specify elixir version
You have to go elixir's github , and then you download the specify version of elixir. Next, you need to extract the elixir compression file.

After that, you go to elixir directory & combine as below
cd otp
./otp_build autoconf
./configure
make
make install


Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

0 nhận xét:

Post a Comment