Total Pageviews

Thursday 5 November 2015

安装编程语言elixir(基于erlang)

For more about Elixir, installation and documentation, check Elixir's website.

Usage

If you want to contribute to Elixir or run it from source, clone this repository to your machine, compile and test it:
git clone https://github.com/elixir-lang/elixir
cd elixir
make 
会显示:
...
==> elixir (compile)
==> eex (compile)
==> mix (compile)
Generated mix app
==> ex_unit (compile)
Generated ex_unit app
==> logger (compile)
Generated logger app
Generated eex app
==> iex (compile)
Generated iex app
root@hb:~/elixir#
然后, 
root@hb:~/elixir# echo 'export PATH=$PATH:~/elixir/bin/' >> /etc/profile && source /etc/profile
 (或者:不这样做,而是make install也行)
root@hb:~/elixir# which iex /usr/local/bin/iex root@hb:~/elixir# which eex root@hb:~/elixir# which mix /usr/local/bin/mix  
root@hb:~/elixir# which elixir 
root@hb:~/elixir# /usr/local/bin/elixir
root@hb:~/elixir# cd bin
root@hb:~/elixir/bin# ls
elixir elixir.bat  elixirc  elixirc.bat  iex  iex.bat mix  mix.bat  mix.ps1
root@hb:~/elixir/bin# ./mix -h
mix                   # Runs the default task (current: "mix run")
mix app.start         # Starts all registered apps
mix app.tree          # Prints the application tree
mix archive           # Lists installed archives
mix archive.build     # Archives this project into a .ez file
mix archive.install   # Installs an archive locally
mix archive.uninstall # Uninstalls archives
mix clean             # Deletes generated application files
mix cmd               # Executes the given command
mix compile           # Compiles source files
mix deps              # Lists dependencies and their status
mix deps.clean        # Deletes the given dependencies' files
mix deps.compile      # Compiles dependencies
mix deps.get          # Gets all out of date dependencies
mix deps.tree         # Prints the dependency tree
mix deps.unlock       # Unlocks the given dependencies
mix deps.update       # Updates the given dependencies
mix do                # Executes the tasks separated by comma
mix escript           # Lists installed escripts
mix escript.build     # Builds an escript for the project
mix escript.install   # Installs an escript locally
mix escript.uninstall # Uninstalls escripts
mix help              # Prints help information for tasks
mix loadconfig        # Loads and persists the given configuration
mix local             # Lists local tasks
mix local.hex         # Installs Hex locally
mix local.public_keys # Manages public keys
mix local.rebar       # Installs Rebar locally
mix new               # Creates a new Elixir project
mix profile.fprof     # Profiles the given file or expression with fprof
mix run               # Runs the given file or expression
mix test              # Runs a project's tests
mix xref              # Performs cross reference checks
iex -S mix            # Starts IEx and runs the default task
root@hb:~/elixir/bin#
这样elixir就安装成功。
If Elixir fails to build (specifically when pulling in a new version via git), be sure to remove any previous build artifacts by running make clean, then make test.
If tests pass, you are ready to move on to the Getting Started guide or to try Interactive Elixir by running: bin/iex in your terminal.
However, if tests fail, it is likely you have an outdated Erlang version (Elixir requires Erlang 18.0 or later). You can check your Erlang version by calling erl in the command line. You will see some information as follows:
Erlang/OTP 18 [erts-7.0] [source] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
If you have the correct version and tests still fail, feel free to open an issue.

Building documentation

Building the documentation requires ExDoc to be installed and built alongside Elixir.
# After cloning and compiling Elixir, in its parent directory:
git clone git://github.com/elixir-lang/ex_doc.git
cd ex_doc && ../elixir/bin/mix do deps.get, compile
cd ../elixir && make docs
This will produce documentation sets for elixirmix, etc., under the doc directory.

Contributing

We appreciate any contribution to Elixir. Check our CODE_OF_CONDUCT.md andCONTRIBUTING.md guides for more information. We usually keep a list of features and bugs in the issue tracker.

Important links

from https://github.com/elixir-lang/elixir
http://elixir-lang.org

相关介绍:
http://blog.eood.cn/elixir
http://elixir-cn.com

相关帖子:http://briteming.blogspot.com/2014/02/linux-vpserlang.html (安装erlang)
http://briteming.blogspot.com/2016/08/centos-7-elixir.html