Debian/Ubuntu

Redhat/Centos

  1. rpm --import https://dist.crystal-lang.org/rpm/RPM-GPG-KEY
  2. cat > /etc/yum.repos.d/crystal.repo <<END
  3. name = Crystal
  4. baseurl = https://dist.crystal-lang.org/rpm/
  5. END
  6. sudo yum install crystal
  7. #更新
  8. sudo yum update crystal

Arch

Gentoo

  1. # equery u dev-lang/crystal
  2. [ Legend : U - final flag setting for installation]
  3. [ : I - package is installed with flag ]
  4. [ Colors : set, unset ]
  5. * Found these USE flags for dev-lang/crystal-0.18.7:
  6. - - examples : Install examples, usually source code
  7. + + xml : Use the dev-libs/libxml2 library to enable Crystal xml module
  8. + - yaml : Use the dev-libs/libyaml library to enable Crystal yaml module
  9. su -
  10. emerge -a dev-lang/crystal

Mac-Osx

Linuxbrew

  1. brew update
  2. brew install crystal-lang

Ubuntu bash - windows

预编译文件安装

下载已编译好的二进制,把它放到环境变量的目录下就可以直接在命令行中运行。

源码安装

  • 安装最新的crystal并带上参数 —with-llvm
  • 安装所有的依赖库
  • 最好先参考一下