Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
22
Help us understand the problem. What is going on with this article?
@tsubu-mustard

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

More than 5 years have passed since last update.

概要

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

参考

22
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
22
Help us understand the problem. What is going on with this article?