Debian/Ubuntu
Redhat/Centos
rpm --import https://dist.crystal-lang.org/rpm/RPM-GPG-KEY
cat > /etc/yum.repos.d/crystal.repo <<END
name = Crystal
baseurl = https://dist.crystal-lang.org/rpm/
END
sudo yum install crystal
#更新
sudo yum update crystal
Arch
Gentoo
# equery u dev-lang/crystal
[ Legend : U - final flag setting for installation]
[ : I - package is installed with flag ]
[ Colors : set, unset ]
* Found these USE flags for dev-lang/crystal-0.18.7:
- - examples : Install examples, usually source code
+ + xml : Use the dev-libs/libxml2 library to enable Crystal xml module
+ - yaml : Use the dev-libs/libyaml library to enable Crystal yaml module
su -
emerge -a dev-lang/crystal
Mac-Osx
Linuxbrew
brew update
brew install crystal-lang
Ubuntu bash - windows
预编译文件安装
下载已编译好的二进制,把它放到环境变量的目录下就可以直接在命令行中运行。
源码安装
- 安装最新的crystal并带上参数 —with-llvm
- 安装所有的依赖库
- 最好先参考一下