LoginSignup
6
9

More than 5 years have passed since last update.

rbenvを使用したRuby環境構築 (Raspbian)

Posted at

Raspberry Pi(Raspbian)にrbenvを使用してRuby環境を構築したので、手順メモを残します。

と言っても、Ruby - rbenv のインストール (Linux Mint) - Qiitaに従っただけですが。

完了状態

  • Ruby 2.2.0が使用可能。

作業手順

rbenvgit cloneします。

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

".bashrc"に追記します。

.bashrc
# rbenv
PATH="$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

".bashrc"を再読み込みします。

$ source .bashrc

ruby-buildgit cloneします。

$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

依存パッケージをインストールします。

$ 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

Rubyをインストールします。すごく時間がかかったので、screenの中で行いました。

$ sudo rbenv install 2.2.0
$ sudo rbenv rehash
$ rbenv versions

rbenv versionsでインストールしたバージョンが表示されるはずです。
デフォルトで使用するRubyのバージョンを設定します。

$ rbenv global 2.2.0
$ ruby -v

ruby -vで設定したバージョンが表示されるはずです。

参考

6
9
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
6
9