LoginSignup
19
22

More than 5 years have passed since last update.

rbenv のインストール (Linux Mint)

Last updated at Posted at 2014-04-06

概要

Linux Mint (Ubuntu系) にrbenvを利用してRubyをインストールする。

環境

  • Linux Mint 16 Petra
  • rbenv 0.4.0-95-gf71e227
  • Ruby 2.1.1p76

内容

  • rbenvをダウンロード。
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
  • .bashrcに追記。
# rbenv
PATH="$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
  • .bashrcの再読み込み。
$ source .bashrc
  • ruby-buildをダウンロード。
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
  • ruby-buildのwikiに記載されている推奨に従い、依存パッケージをインストール。
(old)
$ sudo aptitude install autoconf bison build-essential libssl-dev libyaml-dev libreadline6 libreadline6-dev zlib1g zlib1g-dev

※ruby 2.2.0になって依存パッケージが追加になったようです。

$ sudo aptitude install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
  • インストールできるRubyのバージョン一覧を表示。
$ rbenv install --list
Available versions:
  1.8.6-p383
  1.8.6-p420
  1.8.7-p249
  1.8.7-p302
  1.8.7-p334
  ..
  • Rubyをインストール
$ rbenv install 2.1.1
$ rbenv rehash
$ rbenv versions
* 2.1.1 (set by /home/akira/.rbenv/version)
  • デフォルトで使用するRubyを設定
$ rbenv global 2.1.1
$ ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]
$ which ruby
/home/akira/.rbenv/shims/ruby

参考

19
22
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
22