Ruby
RaspberryPi
raspbian

Raspberry Piでrbenvを使ってRubyをインストールする

More than 1 year has passed since last update.


rbenv


pi

$ cd /opt/src

$ git clone https://github.com/rbenv/rbenv.git
$ sudoedit /etc/profile.d/rbenv.sh


/etc/profile.d/rbenv.sh

export RBENV_ROOT=/opt/src/rbenv

export PATH="$RBENV_ROOT/bin:$PATH"
eval "$(rbenv init -)"


pi

$ source /etc/profile.d/rbenv.sh



ruby-build


pi

$ mkdir /opt/src/rbenv/plugins

$ cd /opt/src/rbenv/plugins
$ git clone git://github.com/sstephenson/ruby-build.git
$ cd /opt/src/rbenv/plugins/ruby-build
$ sudo ./install.sh


rbenv-gemset


pi

$ cd /opt/src/rbenv/plugins

$ git clone git://github.com/jamis/rbenv-gemset.git


rbenv-binstubs


pi

$ cd /opt/src/rbenv/plugins

$ git clone https://github.com/ianheggie/rbenv-binstubs.git


Ruby


pi

$ sudo apt-get install -y libreadline-dev

$ rbenv install 2.4.0
$ rbenv rehash
$ rbenv global 2.4.0