Last active
August 29, 2015 14:14
-
-
Save lazybios/25dbe9c4c71f9d7eb758 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# update os | |
sudo apt-get -y update | |
# install git & curl | |
sudo apt-get -y install git curl | |
# depdency | |
sudo apt-get --no-install-recommends -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev vim | |
# useful tools | |
sudo apt-get install tig tree ack-grep # make using git,vim things more comfortable on production server | |
# install rbenv | |
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv | |
# 用来编译安装 ruby | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
# 用来管理 gemset, 可选, 因为有 bundler 也没什么必要 | |
git clone git://github.com/jamis/rbenv-gemset.git ~/.rbenv/plugins/rbenv-gemset | |
# 通过 gem 命令安装完 gem 后无需手动输入 rbenv rehash 命令, 推荐 | |
git clone git://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash | |
# 通过 rbenv update 命令来更新 rbenv 以及所有插件, 推荐 | |
git clone https://github.com/rkh/rbenv-update.git ~/.rbenv/plugins/rbenv-update | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
#安装 ruby | |
#rbenv install --list # 列出所有 ruby 版本 | |
#rbenv install 1.9.3-p392 # 安装 1.9.3-p392 | |
#rbenv install jruby-1.7.3 # 安装 jruby-1.7.3 | |
#列出版本 | |
#rbenv versions # 列出安装的版本 | |
#rbenv version # 列出正在使用的版本 | |
#设置版本 | |
#rbenv global 1.9.3-p392 # 默认使用 1.9.3-p392 | |
#rbenv shell 1.9.3-p392 # 当前的 shell 使用 1.9.3-p392, 会设置一个 `RBENV_VERSION` 环境变量 | |
#rbenv local jruby-1.7.3 # 当前目录使用 jruby-1.7.3, 会生成一个 `.rbenv-version` 文件 | |
#rbenv rehash # 每当切换 ruby 版本和执行 bundle install 之后必须执行这个命令 | |
#rbenv which irb # 列出 irb 这个命令的完整路径 | |
#rbenv whence irb # 列出包含 irb 这个命令的版本 | |
# modify gem source to taobao | |
gem sources --remove https://rubygems.org/ | |
gem sources -a https://ruby.taobao.org/ | |
gem sources -l | |
# install bundler | |
gem install bundler | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment