The Crystal Programming Language Forum

Is it possible to have multiple versions of Crystal on the same computer?

Is it possible to have multiple versions of Crystal on the same computer, and choose between them for different applications? If yes, how can one do that?

Thank you.

https://github.com/asdf-community/asdf-crystal has the ability to install/use different versions.

Although, would it not be easier to just update everything to work with the latest version?

Thank you again @Blacksmoke16. I am updating an application to work with the latest version. But if for some reason things break, then until I have time to fix the application, I want to have the option of redeploying the current version that is working well.

I really appreciate your help.

Maybe also look into docker? There is an image published for each version.

https://hub.docker.com/r/crystallang/crystal/tags.

Just wanted to say that I tried using asdf crystal and it worked great.

You actually don’t need any special tools for this. Having multiple versions of the Crystal compiler/stdlib should work out of the box. You just install them to different locations. The wrapper executable (which is what you usually call as crystal command) implicitly uses the appropriate stdlib sources which came with that compiler.

Thank you @straight-shoota. That is good to know.