DEV Community

Md Asaduzzaman
Md Asaduzzaman

Posted on

Stop Using Slow Language Shims: How to Manage Node, Go, Ruby, and PHP Fast with Mise

Efficient Polyglot Development on Ubuntu: Switching from asdf to mise

Managing multiple development runtimes like Node.js, Ruby, PHP, and Go can severely slow down your terminal if you rely on traditional shim-based tools like asdf. This guide provides a modern setup utilizing mise, a blazing-fast, Rust-based development environment manager designed to optimize workflows for polyglot developers on Ubuntu.


Why Mise?

  • Instant Switching: Modifies your PATH directly, eliminating shim latency.
  • Unified Config: Manages language versions, environment variables, and tasks inside a single mise.toml.
  • Full Compatibility: Supports core native backends and works flawlessly with all legacy asdf plugins.

Step-by-Step Setup Guide

1. Install Ubuntu System Dependencies

Ensure your system has the required build essentials and development libraries to compile runtimes like Ruby and PHP from source.

sudo apt update && sudo apt install -y \
  curl git build-essential libssl-dev zlib1g-dev \
  libreadline-dev libyaml-dev libxml2-dev libxslt1-dev \
  libcurl4-openssl-dev libffi-dev pkg-config libsqlite3-dev
Enter fullscreen mode Exit fullscreen mode

2. Install Mise

Download and install the native standalone mise binary.

curl https://mise.jdx.dev/install.sh | sh
Enter fullscreen mode Exit fullscreen mode

3. Activate the Shell Hook

Append the activation hook to your shell configuration so mise updates your environment dynamically on directory changes.

For Bash (Default Ubuntu Shell):

echo 'eval "$(~/.local/share/mise/bin/mise activate bash)"' >> ~/.bashrc
source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

For Zsh:

echo 'eval "$(~/.local/share/mise/bin/mise activate zsh)"' >> ~/.zshrc
source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

4. Provision Core Language Runtimes

Install the stable runtime baselines globally.

mise use --global node@lts
mise use --global ruby@latest
mise use --global php@latest
mise use --global go@latest
Enter fullscreen mode Exit fullscreen mode

5. Framework Layer Installation

With your primary runtimes activated, provision the ecosystem-specific global command-line interfaces for your frontend and backend frameworks.

# Node.js Frameworks (NestJS, Angular, Ionic)
npm install -g @nestjs/cli @angular/cli @ionic/cli

# Ruby Framework (Ruby on Rails)
gem install rails

# PHP Framework (Laravel)
composer global require laravel/installer
Enter fullscreen mode Exit fullscreen mode

Project-Level Versioning

To configure a project directory with strict, isolated tool versions, create a mise.toml file in your repository root:

# mise.toml
[tools]
node = "20.11.0"
go = "1.22.0"
php = "8.3.2"
ruby = "3.3.0"

[env]
DATABASE_URL = "postgresql://localhost/my_app"
Enter fullscreen mode Exit fullscreen mode

Whenever you cd into this directory, mise will seamlessly switch to these exact versions.

Top comments (0)