インストール
On Fedora
Red Hat 系のディストリビューションでは、Crystal 公式の rpm リポジトリを利用してインストールできます。 Snapcraft や Linuxbrew も使えます。
Crystal 公式の rpm リポジトリ
To install latest stable Crystal release from the official Crystal repository hosted on the Open Build Service run in your command line:
curl -fsSL https://crystal-lang.org/install.sh | sudo bash
インストールスクリプトはその他のチャンネルのリリースをインストール、もしくは更新するためのオプション引数を受け付けます。
--version
withmajor.minor
orlatest
values--channel
引数では、stable
、unstable
、もしくはnightly
の値を指定できます、
curl -fsSL https://crystal-lang.org/install.sh | sudo bash -s -- --channel=nightly
より詳細な情報はこの告知記事を参照してください。
マニュアルセットアップ
ディストリビューション名とリリース名を次のスクリプトの {REPOSITORY}
に挿入することで、設定できます。
You can find available options on the installation page at OBS.
cat > /etc/yum.repos.d/crystal.repo <<END
[crystal]
name=Crystal
type=rpm-md
baseurl=https://download.opensuse.org/repositories/devel:languages:crystal/{REPOSITORY}/
gpgcheck=1
gpgkey=https://download.opensuse.org/repositories/devel:languages:crystal/{REPOSITORY}/repodata/repomd.xml.key
enabled=1
END
リポジトリの設定が完了すれば、Crystal がインストールできます。
sudo yum install crystal
新しいバージョンの Crystal がリリースされた場合には、以下でアップグレードすることが可能です。
sudo yum update crystal
Snapcraft を使う
Crystal の snap は classic な制限環境下を要求します。snapd
がインストールしてあれば、Crystal をインストールする準備は万端です。
sudo snap install crystal --classic
最新のバージョンを edge
チャンネルを使ってインストールすることもできます。
sudo snap install crystal --classic --edge
より詳しい情報は Crystal の snapcraft のページを参照してください。
Linuxbrew を使う
If you have Linuxbrew installed you’re ready to install Crystal:
brew update
brew install crystal-lang
言語にコントリビュートするつもりであれば、同時に LLVM もインストールしておくとよいでしょう。その場合、最後の行を以下の通りに変更してください。
brew install crystal-lang --with-llvm