Categories
Ubuntu

Solving ASDF Ruby No Version Set Ubuntu 24.04

After installing ASDF in Ubuntu 24.04 and execute gem install, I got error message that no version for ruby, despite I already have it installed.

~/ ruby --version

No version is set for command ruby
Consider adding one of the following versions in your config file at 
ruby 3.0.4

The quick solution is to set the global version of ruby or NodeJS (if you have similar problem). Check with asdf current

asdf current

nodejs          ______          No version is set. Run "asdf <global|shell|local> nodejs <version>"
ruby            ______          No version is set. Run "asdf <global|shell|local> ruby <version>"

Then you can fix this problem by assign asdf global to your installed ruby version

asdf global ruby 3.0.4

Leave a Reply

Your email address will not be published. Required fields are marked *