Code-Hero: Changing the default Ruby version

This documentation is part of the Ruby guide. View the full guide here: Managing Ruby with Code-Hero.

👋 Welcome to the Stackhero documentation!

Stackhero offers Code-Hero, a complete development platform to code in seconds:

  • Code from anywhere: Use any device, be it a desktop, phone, or tablet, without requiring any software installations.
  • Integrated VSCode experience: Work with a customized version of VSCode directly through your browser, featuring a fully functional terminal.
  • Comprehensive toolset: Benefit from a pre-configured environment with tools and languages like Docker, Git, Zsh, Node.js, Go, Python, Ruby, and more.
  • Seamless connectivity: Access your development applications via HTTPS on a public domain, mimicking production conditions. This setup supports webhooks and external integrations effortlessly.

Experience the efficiency and convenience of Stackhero's Code-Hero development cloud solution. It takes just 5 minutes to get started! Simplify your development processes and save valuable time today.

If your project requires a specific Ruby version, you can configure it by following these steps:

  1. Update asdf plugins:

    asdf plugin update --all
    
  2. List available Ruby versions:

    asdf list all ruby
    
  3. Install the desired version:

    asdf install ruby <VERSION>
    
  4. Set the active version:

    • Globally (sets the version for all directories):

      asdf global ruby <VERSION>
      
    • Locally (sets the version for the current directory only):

      asdf local ruby <VERSION>
      

      This command creates a .tool-versions file in your project directory to specify the Ruby version.

  5. Verify the active Ruby version:

    ruby -v