CentOS7安装Elixir
参考2:【Centos 用Kerl安装及管理Erlang】进行安装
2、安装Elixir
$ git clone https://github.com/elixir-lang/elixir.git$ cd elixir
$ make clean test
输出示例:
[root@SummerGao elixir]# make clean testrm -rf ebin
rm -rf lib/*/ebin
rm -rf lib/elixir/src/elixir_parser.erl
make[1]: Entering directory `/home/summergao/elixir"
rm -rf lib/*/_build/
rm -rf lib/*/tmp/
rm -rf lib/elixir/test/ebin/
rm -rf lib/mix/test/fixtures/deps_on_git_repo/
rm -rf lib/mix/test/fixtures/git_rebar/
rm -rf lib/mix/test/fixtures/git_repo/
rm -rf lib/mix/test/fixtures/git_sparse_repo/
rm -f erl_crash.dump
make[2]: Entering directory `/home/summergao/elixir"
rm -f man/elixir.1
rm -f man/elixir.1.bak
rm -f man/iex.1
rm -f man/iex.1.bak
make[2]: Leaving directory `/home/summergao/elixir"
make[1]: Leaving directory `/home/summergao/elixir"
Recompile: src/elixir_utils
Recompile: src/elixir_tokenizer
Recompile: src/elixir_sup
Recompile: src/elixir_rewrite
Recompile: src/elixir_quote
Recompile: src/elixir_parser
Recompile: src/elixir_overridable
Recompile: src/elixir_module
Recompile: src/elixir_map
Recompile: src/elixir_locals
Recompile: src/elixir_lexical
Recompile: src/elixir_interpolation
Recompile: src/elixir_import
Recompile: src/elixir_fn
Recompile: src/elixir_expand
Recompile: src/elixir_errors
Recompile: src/elixir_erl_var
Recompile: src/elixir_erl_try
Recompile: src/elixir_erl_pass
Recompile: src/elixir_erl_for
Recompile: src/elixir_erl_compiler
Recompile: src/elixir_erl_clauses
Recompile: src/elixir_erl
Recompile: src/elixir_env
Recompile: src/elixir_dispatch
Recompile: src/elixir_def
Recompile: src/elixir_config
Recompile: src/elixir_compiler
Recompile: src/elixir_code_server
Recompile: src/elixir_clauses
Recompile: src/elixir_bootstrap
Recompile: src/elixir_bitstring
Recompile: src/elixir_aliases
Recompile: src/elixir
Generated elixir app
==> bootstrap (compile)
Compiled lib/elixir/lib/kernel.ex
Compiled lib/elixir/lib/macro/env.ex
Compiled lib/elixir/lib/keyword.ex
Compiled lib/elixir/lib/module.ex
Compiled lib/elixir/lib/list.ex
Compiled lib/elixir/lib/macro.ex
Compiled lib/elixir/lib/kernel/typespec.ex
Compiled lib/elixir/lib/code.ex
Compiled lib/elixir/lib/code/identifier.ex
Compiled lib/elixir/lib/module/checker.ex
Compiled lib/elixir/lib/module/locals_tracker.ex
Compiled lib/elixir/lib/module/parallel_checker.ex
Compiled lib/elixir/lib/module/types/helpers.ex
Compiled lib/elixir/lib/module/types/infer.ex
Compiled lib/elixir/lib/module/types/pattern.ex
Compiled lib/elixir/lib/module/types/expr.ex
Compiled lib/elixir/lib/module/types.ex
Compiled lib/elixir/lib/kernel/utils.ex
Compiled lib/elixir/lib/exception.ex
Compiled lib/elixir/lib/protocol.ex
Compiled lib/elixir/lib/stream/reducers.ex
Compiled lib/elixir/lib/enum.ex
Compiled lib/elixir/lib/map.ex
Compiled lib/elixir/lib/inspect/algebra.ex
Compiled lib/elixir/lib/inspect.ex
Compiled lib/elixir/lib/access.ex
Compiled lib/elixir/lib/range.ex
Compiled lib/elixir/lib/regex.ex
Compiled lib/elixir/lib/string.ex
Compiled lib/elixir/lib/string/chars.ex
Compiled lib/elixir/lib/io.ex
Compiled lib/elixir/lib/path.ex
Compiled lib/elixir/lib/file.ex
Compiled lib/elixir/lib/system.ex
Compiled lib/elixir/lib/kernel/cli.ex
Compiled lib/elixir/lib/kernel/error_handler.ex
Compiled lib/elixir/lib/kernel/parallel_compiler.ex
Compiled lib/elixir/lib/kernel/lexical_tracker.ex
make[1]: Entering directory `/home/summergao/elixir"
==> unicode (compile)
Compiling lib/elixir/unicode/unicode.ex
Compiling lib/elixir/unicode/properties.ex
Compiling lib/elixir/unicode/tokenizer.ex
make[1]: Leaving directory `/home/summergao/elixir"
==> elixir (compile)
Compiling lib/atom.ex
Compiling lib/agent.ex
Compiling lib/behaviour.ex
Compiling lib/bitwise.ex
Compiling lib/application.ex
Compiling lib/access.ex
Compiling lib/calendar.ex
Compiling lib/calendar/date_range.ex
Compiling lib/calendar/date.ex
Compiling lib/calendar/time_zone_database.ex
Compiling lib/calendar/time.ex
Compiling lib/calendar/iso.ex
Compiling lib/code.ex
Compiling lib/calendar/naive_datetime.ex
Compiling lib/calendar/datetime.ex
Compiling lib/code/identifier.ex
Compiling lib/code/typespec.ex
Compiling lib/config.ex
Compiling lib/collectable.ex
Compiling lib/config/provider.ex
Compiling lib/dict.ex
Compiling lib/file.ex
Compiling lib/file/stream.ex
Compiling lib/code/formatter.ex
Compiling lib/function.ex
Compiling lib/float.ex
Compiling lib/gen_event/stream.ex
Compiling lib/gen_server.ex
Compiling lib/agent/server.ex
Compiling lib/hash_dict.ex
Compiling lib/hash_set.ex
Compiling lib/enum.ex
Compiling lib/integer.ex
Compiling lib/inspect/algebra.ex
Compiling lib/io.ex
Compiling lib/io/ansi.ex
Compiling lib/inspect.ex
Compiling lib/io/ansi/docs.ex
Compiling lib/io/stream.ex
Compiling lib/kernel/cli.ex
Compiling lib/kernel/error_handler.ex
Compiling lib/exception.ex
Compiling lib/kernel/lexical_tracker.ex
Compiling lib/kernel/parallel_require.ex
Compiling lib/kernel/parallel_compiler.ex
Compiling lib/kernel/special_forms.ex
Compiling lib/kernel/utils.ex
Compiling lib/kernel/typespec.ex
Compiling lib/keyword.ex
Compiling lib/list.ex
Compiling lib/kernel.ex
Compiling lib/macro/env.ex
Compiling lib/map.ex
Compiling lib/list/chars.ex
Compiling lib/map_set.ex
Compiling lib/module/checker.ex
Compiling lib/module/locals_tracker.ex
Compiling lib/module/parallel_checker.ex
Compiling lib/macro.ex
Compiling lib/module/types.ex
Compiling lib/module/types/helpers.ex
Compiling lib/module/types/expr.ex
Compiling lib/module.ex
Compiling lib/module/types/infer.ex
Compiling lib/node.ex
Compiling lib/port.ex
Compiling lib/module/types/pattern.ex
Compiling lib/path.ex
Compiling lib/option_parser.ex
Compiling lib/protocol.ex
Compiling lib/record/extractor.ex
Compiling lib/range.ex
Compiling lib/record.ex
Compiling lib/process.ex
Compiling lib/config/reader.ex
Compiling lib/dynamic_supervisor.ex
Compiling lib/regex.ex
Compiling lib/set.ex
Compiling lib/file/stat.ex
Compiling lib/gen_event.ex
Compiling lib/stream/reducers.ex
Compiling lib/string_io.ex
Compiling lib/supervisor.ex
Compiling lib/string/chars.ex
Compiling lib/supervisor/default.ex
Compiling lib/supervisor/spec.ex
Compiling lib/stream.ex
Compiling lib/string.ex
Compiling lib/registry.ex
Compiling lib/task.ex
Compiling lib/task/supervised.ex
Compiling lib/tuple.ex
Compiling lib/system.ex
Compiling lib/task/supervisor.ex
Compiling lib/uri.ex
Compiling lib/version.ex
Compiling lib/base.ex
make[1]: Entering directory `/home/summergao/elixir"
Generated elixir app
make[1]: Leaving directory `/home/summergao/elixir"
==> eex (compile)
Compiling lib/eex/engine.ex
Compiling lib/eex/compiler.ex
Compiling lib/eex/tokenizer.ex
Compiling lib/eex/smart_engine.ex
Compiling lib/eex.ex
==> mix (compile)
Compiling lib/mix.ex
Compiling lib/mix/cli.ex
Compiling lib/mix/config.ex
Compiling lib/mix/dep/elixir_scm.ex
Compiling lib/mix/dep/lock.ex
Compiling lib/mix/dep/umbrella.ex
Compiling lib/mix/generator.ex
Compiling lib/mix/hex.ex
Compiling lib/mix/dep.ex
Compiling lib/mix/local.ex
Compiling lib/mix/dep/converger.ex
Compiling lib/mix/dep/fetcher.ex
Compiling lib/mix/dep/loader.ex
Compiling lib/mix/local/installer.ex
Compiling lib/mix/public_key.ex
Compiling lib/mix/exceptions.ex
Compiling lib/mix/project_stack.ex
Compiling lib/mix/project.ex
Compiling lib/mix/remote_converger.ex
Compiling lib/mix/rebar.ex
Compiling lib/mix/scm.ex
Compiling lib/mix/scm/git.ex
Compiling lib/mix/scm/path.ex
Compiling lib/mix/release.ex
Compiling lib/mix/shell.ex
Compiling lib/mix/shell/process.ex
Compiling lib/mix/shell/quiet.ex
Compiling lib/mix/shell/io.ex
Compiling lib/mix/state.ex
Compiling lib/mix/task.compiler.ex
Compiling lib/mix/compilers/erlang.ex
Compiling lib/mix/task.ex
Compiling lib/mix/tasks/archive.uninstall.ex
Compiling lib/mix/tasks/clean.ex
Compiling lib/mix/tasks/archive.install.ex
Compiling lib/mix/compilers/elixir.ex
Compiling lib/mix/tasks/archive.ex
Compiling lib/mix/tasks/archive.check.ex
Compiling lib/mix/tasks/archive.build.ex
Compiling lib/mix/tasks/app.tree.ex
Compiling lib/mix/compilers/test.ex
Compiling lib/mix/tasks/app.start.ex
Compiling lib/mix/tasks/cmd.ex
Compiling lib/mix/tasks/compile.all.ex
Compiling lib/mix/tasks/compile.elixir.ex
Compiling lib/mix/tasks/compile.app.ex
Compiling lib/mix/tasks/compile.erlang.ex
Compiling lib/mix/tasks/compile.leex.ex
Compiling lib/mix/tasks/compile.ex
Compiling lib/mix/tasks/compile.yecc.ex
Compiling lib/mix/tasks/compile.protocols.ex
Compiling lib/mix/tasks/deps.clean.ex
Compiling lib/mix/tasks/deps.ex
Compiling lib/mix/tasks/deps.get.ex
Compiling lib/mix/tasks/deps.compile.ex
Compiling lib/mix/tasks/deps.loadpaths.ex
Compiling lib/mix/tasks/deps.precompile.ex
Compiling lib/mix/tasks/deps.tree.ex
Compiling lib/mix/tasks/deps.unlock.ex
Compiling lib/mix/tasks/deps.update.ex
Compiling lib/mix/tasks/do.ex
Compiling lib/mix/tasks/escript.ex
Compiling lib/mix/tasks/escript.install.ex
Compiling lib/mix/tasks/escript.uninstall.ex
Compiling lib/mix/tasks/escript.build.ex
Compiling lib/mix/tasks/help.ex
Compiling lib/mix/tasks/iex.ex
Compiling lib/mix/tasks/format.ex
Compiling lib/mix/tasks/loadconfig.ex
Compiling lib/mix/tasks/loadpaths.ex
Compiling lib/mix/tasks/local.ex
Compiling lib/mix/tasks/local.hex.ex
Compiling lib/mix/tasks/local.public_keys.ex
Compiling lib/mix/tasks/local.rebar.ex
Compiling lib/mix/tasks/profile.cprof.ex
Compiling lib/mix/tasks/profile.eprof.ex
Compiling lib/mix/tasks/profile.fprof.ex
Compiling lib/mix/tasks/release.init.ex
Compiling lib/mix/tasks/run.ex
Compiling lib/mix/tasks/new.ex
Compiling lib/mix/tasks/will_recompile.ex
Compiling lib/mix/tasks_server.ex
Compiling lib/mix/tasks/test.ex
Compiling lib/mix/tasks/release.ex
Compiling lib/mix/tasks/xref.ex
Compiling lib/mix/utils.ex
Generated mix app
==> ex_unit (compile)
Compiling lib/ex_unit/capture_io.ex
Compiling lib/ex_unit/callbacks.ex
Compiling lib/ex_unit/capture_log.ex
Compiling lib/ex_unit/capture_server.ex
Compiling lib/ex_unit/case_template.ex
Compiling lib/ex_unit/assertions.ex
Compiling lib/ex_unit.ex
Compiling lib/ex_unit/case.ex
Compiling lib/ex_unit/event_manager.ex
Compiling lib/ex_unit/failures_manifest.ex
Compiling lib/ex_unit/filters.ex
Compiling lib/ex_unit/formatter.ex
Compiling lib/ex_unit/diff.ex
Compiling lib/ex_unit/on_exit_handler.ex
Compiling lib/ex_unit/doc_test.ex
Compiling lib/ex_unit/runner_stats.ex
Compiling lib/ex_unit/runner.ex
Compiling lib/ex_unit/server.ex
Compiling lib/ex_unit/cli_formatter.ex
Generated ex_unit app
==> logger (compile)
Compiling lib/logger/backend_supervisor.ex
Compiling lib/logger/config.ex
Compiling lib/logger/counter.ex
Compiling lib/logger/filter.ex
Compiling lib/logger.ex
Compiling lib/logger/backends/console.ex
Compiling lib/logger/app.ex
Compiling lib/logger/formatter.ex
Compiling lib/logger/handler.ex
Compiling lib/logger/utils.ex
Compiling lib/logger/watcher.ex
Compiling lib/logger/translator.ex
Generated logger app
Generated eex app
==> iex (compile)
Compiling lib/iex/app.ex
Compiling lib/iex.ex
Compiling lib/iex/broker.ex
Compiling lib/iex/cli.ex
Compiling lib/iex/autocomplete.ex
Compiling lib/iex/config.ex
Compiling lib/iex/history.ex
Compiling lib/iex/helpers.ex
Compiling lib/iex/pry.ex
Compiling lib/iex/introspection.ex
Compiling lib/iex/evaluator.ex
Compiling lib/iex/server.ex
Compiling lib/iex/info.ex
Generated iex app
==> elixir (eunit)
All 191 tests passed.
==> elixir (ex_unit)
Excluding tags: [windows: true]
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Finished in 75.6 seconds (36.0s on load, 39.5s on tests)
1584 doctests, 3460 tests, 0 failures, 8 excluded
Randomized with seed 654688
==> ex_unit (ex_unit)
.................................................................................................................................................................................................................................................................................................................................................................
Finished in 5.5 seconds (3.4s on load, 2.0s on tests)
42 doctests, 311 tests, 0 failures
Randomized with seed 574131
==> logger (ex_unit)
................................................................................................................................
Finished in 3.7 seconds (2.9s on load, 0.8s on tests)
3 doctests, 125 tests, 0 failures
Randomized with seed 683382
==> mix (ex_unit)
Excluding tags: [windows: true]
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Finished in 443.2 seconds (12.9s on load, 430.3s on tests)
9 doctests, 616 tests, 0 failures
Randomized with seed 368174
==> eex (ex_unit)
..............................................................................................
Finished in 0.6 seconds (0.6s on load, 0.04s on tests)
5 doctests, 89 tests, 0 failures
Randomized with seed 734409
==> iex (ex_unit)
.......................................................................................................................................................................................................................................
Finished in 13.4 seconds (1.5s on load, 11.9s on tests)
231 tests, 0 failures
Randomized with seed 396224
如果测试通过,则表示编译安装完成。
3、配置环境变量
接下来将Elixir的bin路径添加到PATH环境变量中,否则Elixir将无法正常工作。
方法一(暂时生效)
现在运行以下命令:
export PATH="$PATH:/home/summergao/elixir/bin"
在这里,我把Elixir安装在了 /home/summergao/elixir
。你必须将此路径替换为你实际的Elixir安装路径。
方法二(只对当前登陆用户生效,永久生效)
vim ~/.bash_profile
默认如下:
PATH=$PATH:$HOME/bin
添加后:
PATH=$PATH:$HOME/bin:$PATH:/home/summergao/elixir/bin
接下来执行 source ~/.bash_profile
使其立即生效或者 reboot
重启生效
source ~/.bash_profile
方法三(对所有系统用户生效,永久生效)
vim /etc/profile
在export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL 下面添加
export ELIXIR_HOME=/home/summergao/elixir/export PATH=$PATH:$ELIXIR_HOME/bin
接下来执行 source /etc/profile
使其立即生效或者 reboot
重启生效
source /etc/profile
验证Elixir
iex
如果你看到Elixir shell,则表示安装成功!
同样,要关闭Elixir shell,只需按两次Ctrl-C。
查看Elixir版本:
elixir --version
输出示例:
以上是 CentOS7安装Elixir 的全部内容, 来源链接: utcz.com/z/513941.html