Rvm安装ruby
Table of Contents
rvm 卸载
rvm implode sudo rm -rf .rvm .rvmrc /etc/rvmrc ; 最后不要忘记了注释 .bashrc 或者 .bash_profile 或者 .profile 中的相关语句 #[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
下载rvm
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 $ curl -sSL https://get.rvm.io | bash -s stable # 如果上面的连接失败,可以尝试: $ curl -L https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable
离线安装
cd ~ mkdir install && cd install curl -sSL https://github.com/rvm/rvm/tarball/stable -o rvm-stable.tar.gz mkdir rvm && cd rvm tar --strip-components=1 -xzf ../rvm-stable.tar.gz ./install --auto-dotfiles rvm -v
报错没有witch
yum -y install witch
然后,载入 RVM 环境(新开 Termal 就不用这么做了,会自动重新载入的)
source ~/.rvm/scripts/rvm or source /usr/local/rvm/scripts/rvm
修改 RVM 下载 Ruby 的源,到 Ruby China 的镜像:
echo "ruby_url=https://cache.ruby-china.com/pub/ruby" > ~/.rvm/user/db
检查一下是否安装正确
rvm -v
下载ruby2.4.0
rvm install 2.4.0 ruby -v gem -v
rvm 常用命令
rvm list rvm use 2.4.0 --default
替换为ruby-china源
gem source -r https://rubygems.org/ gem source -a https://gems.ruby-china.com/ gem source -l