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
PATHdirectly, 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
asdfplugins.
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
2. Install Mise
Download and install the native standalone mise binary.
curl https://mise.jdx.dev/install.sh | sh
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
For Zsh:
echo 'eval "$(~/.local/share/mise/bin/mise activate zsh)"' >> ~/.zshrc
source ~/.zshrc
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
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
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"
Whenever you cd into this directory, mise will seamlessly switch to these exact versions.
Top comments (0)