Ruby 配置

rbenv

1
git clone https://github.com/rbenv/rbenv.git ~/.rbenv

环境变量

1
echo 'export PATH="$HOME/.rbenv/bin:$PATH"\neval "$(rbenv init -)"' >> ~/.zshrc

ruby-build

1
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build

环境变量

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export PATH="${HOME}/.rbenv/shims:${PATH}"
export RBENV_SHELL=zsh
source '${HOME}/.rbenv/libexec/../completions/rbenv.zsh'
command rbenv rehash 2>/dev/null
rbenv() {
local command
command="${1:-}"
if [ "$#" -gt 0 ]; then
shift
fi

case "$command" in
rehash|shell)
eval "$(rbenv "sh-$command" "$@")";;
*)
command rbenv "$command" "$@";;
esac
}

查看 ruby 版本

1
rbenv install -l

安装 ruby

1
rbenv install 2.6.0

×

纯属好玩

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

文章目录
,