Skip to content

Instantly share code, notes, and snippets.

@fernandes
Last active November 3, 2021 18:41
Show Gist options
  • Save fernandes/52dce07fd0b8b902dcfb582c21c56d57 to your computer and use it in GitHub Desktop.
Save fernandes/52dce07fd0b8b902dcfb582c21c56d57 to your computer and use it in GitHub Desktop.
Install Multiple Crystal Lang Versions on OSX (Homebrew)

Install Multiple Crystal Lang Versions on OSX (Homebrew)

brew unlink crystal-lang
brew install <url to formula> # check more on appendix below

If you'd like to check for installed crystal versions, just run:

brew switch crystal-lang 0
# Error: crystal-lang does not have a version "0" in the Cellar.
# Versions available: 0.15.0, 0.16.0, 0.17.0, 0.17.1, 0.17.2, 0.17.3, 0.17.4

ps: 0 is just a dummy non-existing version so homebrew breaks and show you available versions.

Then you can easily switch to a specific version using:

brew switch crystal-lang 0.17.4

Being honestly, this approach is only useful if you need to build a project or run spec suite, if you have need to run a small snippet, use http://carc.in/ and make world a better place! :)

Appendix Crystal Homebrew History

@carcinocron
Copy link

brew switch crystal-lang 0
Error: Unknown command: switch

@fernandes
Copy link
Author

hey @InstanceOfMichael , homebrew got rid of the switch command

I've been using asdf-vm.com to manage crystal versions and it works like a charm, I do recommend

best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment