Installing the Crystal compiler
The first step is to make sure the Crystal compiler is correctly installed. Try running the crystal --version
command from your terminal. You can skip to the next section if it successfully shows the compiler version and target architecture.
Go to https://crystal-lang.org/install and check the exact instructions for your operating system. On macOS, Crystal is available from Homebrew. On most Linux distributions, Crystal is available from a repository. Crystal is also available for BSD systems.
Installing the compiler on Windows
On Windows, the Crystal compiler is still experimental (as of Crystal 1.4.0). So, you must enable the Windows Subsystem for Linux (WSL) and use a Linux distribution inside Windows.
If you haven't used WSL yet, enabling it is simple. You will need to be running either Windows 10 or Windows 11. Open Windows PowerShell, select Run as Administrator, and run the wsl --install
command.