2010年09月04日
RVM (Ruby Version Manager)
gem に RVM というものがあり、バージョンの違う複数の Ruby を切り替えて使う事ができる。
インストールして shell の設定ファイルを少しいじると使える様になるらしいです。
そして、tcsh では、使えないらしい。
まず、gem を更新する。
rvm をインストールする。
以下のメッセージが出る。
rvm-install を実行する。
以下のメッセージが出る。
.
.
.
You must now finish the install manually:
1) Place the folowing line at the end of your shell's loading files(.bashrc or .bash_profile for bash and .zshrc for zsh), after all path/variable settings:
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
Please note that this must only occur once - so, you only need to add it the first time you install rvm.
2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly).
This means that if you see '[ -z "$PS1" ] && return' then you must change this line to:
if [[ -n "$PS1" ]] ; then
... original content that was below the && return line ...
fi # <= be sure to close the if.
#EOF .bashrc
Be absolutely *sure* to REMOVE the '&& return'.
If you wish to DRY up your config you can 'source ~/.bashrc' at the bottom of your .bash_profile.
placing all non-interactive items in the .bashrc, including the 'source' line above
3) Then CLOSE THIS SHELL and open a new one in order to use rvm.
Installation of RVM to /Users/user_name/.rvm/ is complete.
.bashrc に以下を追加
新たに shell を立ち上げると rvm が使える様になる。
rvm で ruby1.9.2 を install する。
切り換え対象を確認する。
切り替える
インストールして shell の設定ファイルを少しいじると使える様になるらしいです。
そして、tcsh では、使えないらしい。
まず、gem を更新する。
% sudo gem update
rvm をインストールする。
% sudo gem install rvm
以下のメッセージが出る。
********************************************************************************
In order to setup rvm for your user's environment you must now run rvm-install.
rvm-install will be found in your current gems bin directory corresponding to where the gem was installed.
rvm-install will install the scripts to your user account and append itself to your profiles in order to
inject the proper rvm functions into your shell so that you can manage multiple rubies.
********************************************************************************
Successfully installed rvm-1.0.2
1 gem installed
Installing ri documentation for rvm-1.0.2...
Installing RDoc documentation for rvm-1.0.2...
In order to setup rvm for your user's environment you must now run rvm-install.
rvm-install will be found in your current gems bin directory corresponding to where the gem was installed.
rvm-install will install the scripts to your user account and append itself to your profiles in order to
inject the proper rvm functions into your shell so that you can manage multiple rubies.
********************************************************************************
Successfully installed rvm-1.0.2
1 gem installed
Installing ri documentation for rvm-1.0.2...
Installing RDoc documentation for rvm-1.0.2...
rvm-install を実行する。
% rvm-install
以下のメッセージが出る。
.
.
.
You must now finish the install manually:
1) Place the folowing line at the end of your shell's loading files(.bashrc or .bash_profile for bash and .zshrc for zsh), after all path/variable settings:
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
Please note that this must only occur once - so, you only need to add it the first time you install rvm.
2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly).
This means that if you see '[ -z "$PS1" ] && return' then you must change this line to:
if [[ -n "$PS1" ]] ; then
... original content that was below the && return line ...
fi # <= be sure to close the if.
#EOF .bashrc
Be absolutely *sure* to REMOVE the '&& return'.
If you wish to DRY up your config you can 'source ~/.bashrc' at the bottom of your .bash_profile.
placing all non-interactive items in the .bashrc, including the 'source' line above
3) Then CLOSE THIS SHELL and open a new one in order to use rvm.
Installation of RVM to /Users/user_name/.rvm/ is complete.
.bashrc に以下を追加
if ( -s $HOME/.rvm/scripts/rvm ) then
source $HOME/.rvm/scripts/rvm
fi
source $HOME/.rvm/scripts/rvm
fi
新たに shell を立ち上げると rvm が使える様になる。
rvm で ruby1.9.2 を install する。
% rvm install ruby-1.9.2
切り換え対象を確認する。
% rvm list
切り替える
% rvm use 1.9.2
【(カテゴリなし)の最新記事】
投稿者:tech|20:58