70
70

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ちょっとgem試したい時にrbenv-gemset使う

Last updated at Posted at 2014-04-08

#背景
rbenvでもrvmみたいにgemset使いたい

#準備
rbenv 入れるのは、下記のエントリが分かりやすかった:
http://qiita.com/checkpoint/items/f8e65380d9cb0182218d

rbenv-rehash 入ってると、rehash しなくていいよ

gem install rbenv-rehash

ちょっとgem試したいけど環境汚したくないので、gemsetで管理したい
rbenv-gemset を入れる

brew install rbenv-gemset

#rbenv-gemset 使い方

gemsetの作成

例えばruby2.1.0でsampleというgemsetを作る

rbenv gemset create 2.1.0 sample

list コマンドで一覧が見える

rbenv gemset list
=> 
2.1.0
  sample

active コマンドで現在有効なgemsetが分かる

rbenv gemset active
=>no active gemsets

作っただけでは、有効にならない

gemset の選択

.rbenv-gemsets というファイルを作ってgemset名を書いておく

echo >.rbenv-gemsets sample

すると、そのディレクトリ以下で有効なgemsetがsampleになる

rbenv gemset active
=> sample global

gemset の削除

rbenv gemset delete 2.1.0 sample
=> deleted sample from 2.1.0
70
70
2

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
70
70

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?