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
105
Help us understand the problem. What is going on with this article?
@semind

rbenvを使ってシステムワイドにrubyをインストールする方法

More than 5 years have passed since last update.

各ユーザごとではなく/usr/local/以下にrbenvをインストールしてシステムワイドに使えるようにする手順。各ユーザがstaffグループに参加していると仮定している。

rbenvインストール

cd /usr/local
git clone git://github.com/sstephenson/rbenv.git rbenv
chgrp -R staff rbenv
chmod -R g+rwxXs rbenv

/etc/profileとか~/.profileとかで環境変数を設定しておく。設定した後はsourceコマンドで適応しておくと良い。

環境変数設定

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

rubyをインストールするためにruby-buildをインストール

ruby-buildインストール

mkdir /usr/local/rbenv/plugins
cd /usr/local/rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git
chgrp -R staff ruby-build
chmod -R g+rwxs ruby-build

rbenv経由でrubyをインストール

rbenv install 1.9.3-p194
rbenv rehash
rbenv global 1.9.3-p194
105
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
semind
VPoEとかやってます。

Comments

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