DRYな備忘録

Don't Repeat Yourself.

Rubyのバージョンマネージャはrvmじゃなくてrbenvのがいいっぽいので

まあ当方こだわりは無いんですけどね。

rvmをアンインストール

% rvm seppuku

rbenvをインストール

ふつうにhomebrewで入れればいいっぽい

% brew install rbenv
% brew install ruby-build
% rbenv help
Usage: rbenv <command> [<args>]

Some useful rbenv commands are:
   commands    List all available rbenv commands
   local       Set or show the local application-specific Ruby version
   global      Set or show the global Ruby version
   shell       Set or show the shell-specific Ruby version
   install     Install a Ruby version using ruby-build
   uninstall   Uninstall a specific Ruby version
   rehash      Rehash rbenv shims (run this after installing executables)
   version     Show the current Ruby version and its origin
   versions    List all Ruby versions available to rbenv
   which       Display the full path to an executable
   whence      List all Ruby versions that contain the given executable

See `rbenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/sstephenson/rbenv#readme

rubyをバージョン指定でインストール

インストール可能なバージョンを確認

% rbenv install -l

一番新しそうなのでいいや

% rbenv install 2.1.3

確認

% rbenv versions
* system (set by /Users/otiai10/.rbenv/version)
  2.1.3

使うrubyのバージョンを固定

めんどいからglobalに2.1.3にしとこう

% rbenv global 2.1.3

確認

% rbenv versions
  system
* 2.1.3 (set by /Users/otiai10/.rbenv/version)

カレントディレクトリ以下だけに適用したい場合は

% rbenv local 2.1.3

雑感

  • rubyこだわらないしrbenvでもrvmでも使えればいいんですけどね、今のところは困らないので

DRY