2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Elixir miseでインストール

Last updated at Posted at 2025-04-11
#!/bin/bash

# Execute this script current shell.
# $ source ./install_mise.sh

# mise
# https://mise.jdx.dev/getting-started.html
# https://github.com/jdx/mise?tab=readme-ov-file

# If you use Linux, install mise.
# After install mise, add path in current shell
_linux_install_mise() {
  echo "----- Linux install mise."
  curl https://mise.run | sh

  ~/.local/bin/mise --version

  echo "----- Add path to ~/.bashrc."

  # .bashrc
  echo '# mise' >> ~/.bashrc
  echo "eval \"\$(/home/pi/.local/bin/mise activate bash)\"" >> ~/.bashrc

  source ~/.bashrc
  which mise
}

# If you use macOS, execute `brew install mise`.
# After install mise, add path in current shell
_macOS_install_mise() {
  echo "----- macOS install mise."
  brew update
  brew install mise

  echo "----- Add path to ~/.zshrc."

  # .zshrc
  echo '# mise' >> ${ZDOTDIR:-~}/.zshrc
  echo 'eval "$(mise activate zsh)"' >> ${ZDOTDIR:-~}/.zshrc

  source ${ZDOTDIR:-~}/.zshrc
  which mise
}

install_mise() {
  if [ "$(uname)" = 'Darwin' ]; then
    _macOS_install_mise
  else
    _linux_install_mise
  fi
}

install_mise
#!/bin/bash

# Install version
ELIXIR_V=1.18.3
ERLANG_V=27.3.2

# Update mise.
# If you use macOS, execute `brew upgrade mise`.
# If you use Linux, execute `mise self-update`.
update_mise() {
  if [ "$(uname)" = 'Darwin' ]; then
    echo "----- macOS update brew mise."
    brew update
    brew upgrade mise
  else
    echo "----- Linux update mise."
    mise self-update
  fi
}

# List installable elixir and eralng versions.
version_list() {
  mise ls-remote erlang | tail
  mise ls-remote elixir | tail
}

# Uninstall elixir and erlang current setting versions.
uninstall() {

  echo "----- Uninstall Erlang."
  mise uninstall erlang

  echo "----- Uninstal Elixir."
  mise uninstall elixir
}

# Install specified elixir and erlang version.
# And set global installed version.
install_elixir() {

  echo "----- Install Erlang."
  mise use --global erlang@${ERLANG_V}

  echo "----- Install Elixir."
  mise use --global elixir@${ELIXIR_V}

  mise ls
}

# version_list
update_mise
uninstall
install_elixir
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?