回上一頁

asdf install Ruby

使用asdf安裝Ruby與安裝流程收斂筆記記錄

此篇使用 Mac OS 開發

 

brew + asdf 腳本設定,

腳本檔盡可能集中管理,

避免重複到無用的設定,

會搞亂(這多操作幾次就會越來越熟)。

 

install asdf:

  
    git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.13.1
  

 

設定在腳本檔裡:($HOME 是指 使用者home目錄)

  
    . $HOME/.asdf/asdf.sh
    legacy_version_file = yes
  

 

 

# asdf use openssl1.1                                                                                                     

  
    # asdf use openssl1.1                                                                                                     
    export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"  
    export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include"
    export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
  

 

如果是使用 Mac,brew 建議安裝在 opt底下,opt是用ARM來運行,

M系列晶片才有,英特爾(舊款)則略過。

  
    . "$HOME/.asdf/asdf.sh"
    . "/opt/homebrew/opt/asdf/libexec/asdf.sh"
    . /opt/homebrew/opt/asdf/libexec/asdf.sh
    . /opt/homebrew/opt/asdf/etc/bash_completion.d/asdf.bash
  

 

附上X86位置:

  
    . /usr/local/opt/asdf/libexec/asdf.sh
    . /usr/local/opt/asdf/etc/bash_completion.d/asdf.bash
  

 

使用 asdf 安裝 Ruby:

  
    asdf plugin-add ruby
    asdf install ruby x.x.x (版本序)
  

 

參考資料:

1.https://asdf-vm.com/guide/getting-started.html

2.https://brew.sh/