Tao He

Tao He

  • Docs
  • API
  • Help
  • Blog

›Recent Posts

Recent Posts

  • Microsoft PowerPoint
  • Chrome
  • Alfred
  • Docusaurus
  • Git Commands

Ruby

July 14, 2014

{% include JB/setup %}

Install Ruby

Ubuntu

sudo apt-get install git ruby1.9.1 ruby1.9.1-dev make rake
ruby --version

macOS

brew install git ruby ruby-build make
ruby --version
gem environment

Method 1 (Recommended)

Add to ~/.zshrc

plugins=(ruby)

Method 2

Copy EXECUTABLE DIRECTORY: /usr/local/Cellar/ruby/2.2.2/bin

Add /usr/local/Cellar/ruby/2.2.2/bin to PATH in ~/.zshrc

Use Taobao RubyGems Mirror

gem sources --remove https://rubygems.org/
gem sources -a https://ruby.taobao.org/
gem sources -l
# Ensure only ruby.taobao.org
sudo gem update --system

RubyGems Mirror

Install rbenv

brew install rbenv
type rbenv

Configure

Method 1 (Recommended)

Add to ~/.zshrc

plugins=(rbenv)

Method 2

Add $HOME/.rbenv/bin to PATH in ~/.zshrc

Add to ~/.zshrc

if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

Install Version

rbenv install -l
rbenv install 2.2.2
Recent Posts
  • Install Ruby
    • Ubuntu
    • macOS
  • Use Taobao RubyGems Mirror
  • Install rbenv
    • Configure
    • Install Version
Tao He
Docs
Getting Started (or other categories)Guides (or other categories)API Reference (or other categories)
Community
User ShowcaseStack OverflowProject ChatTwitter
More
BlogGitHubStar
Facebook Open Source
Copyright © 2019 Your Name or Your Company Name