debian下安裝rvm配置ruby環境

注意:不能以root來跑linux

先安裝rvmshell

curl -sSL https://rvm.io/mpapis.asc | gpg --import -; curl -L get.rvm.io | bash -s stable

 

source ~/.rvm/scripts/rvm

 

修改rvm的安裝源爲淘寶,提升安裝速度(如今都用https)api

macruby

sed -i .bak -E 's!https?://cache.ruby-lang.org/pub/ruby!https://ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db

 

linuxbash

sed -i -E 's!https?://cache.ruby-lang.org/pub/ruby!https://ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db

 

 

安裝必須的東西curl

rvm requirements


看看裝哪一個rubyide

rvm list known


2.1.3貌似最新ui

rvm install ruby-



設置默認url

rvm use ruby-2.3.0 --default

 


若是看到spa

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for an example.

則在.bashrc添加

source ~/.rvm/scripts/rvm

重啓bash

 

修改gem的源到淘寶

 

gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/


下面直接安裝rails

gem install rails --no-doc -V

 

修改默認源,命令行中運行:

bundle config mirror.https://rubygems.org https://ruby.taobao.org

 

用法:

rails new helloWorld --skip-bundle
cd helloWorld
bundle install
相關文章
相關標籤/搜索