※こちらは旧サイトです(新サイトはこちら

Debian8にrbenvインストール

2016-05-18 18:51:09

rbenvをインストール

公式どおりにやってみた

// バニラなのでとりあえず必要な物を
$ sudo apt-get install gcc make git

// clone。
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv

// make。一瞬で終わった
$ cd ~/.rbenv && src/configure && make -C src

// PATHを通す
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile

// 入った
$ 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
   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/rbenv/rbenv#readme

rbenv install が無い

公式には書いてなかったけど、ruby-buildも入れないと、installコマンドが使えなかった

// 残念な結果
$ rbenv install -l
rbenv: no such command `install'

// ruby-buildのインストール
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

// install と uninstall が増えた
$ 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/rbenv/rbenv#readme

// 使ってみる
$ rbenv install -l
Available versions:
  1.8.5-p113
  1.8.5-p114
  1.8.5-p115
  1.8.5-p231
  1.8.5-p52
  1.8.6-p110
  1.8.6-p111
  1.8.6-p114
  1.8.6-p230
(以下省略)