rvmã使ã
rvmï¼
Rubyã«ã¯ã1.8ç³»ã¨1.9ç³»ããã£ã¦ããããã使ãåããã«ã¯ã©ãããã ããã¨æã£ã¦ããã®ã ãã©ãè·å ´ã®äººããã£ããã¨æãã¦ãããã(ããããç¥ããªãã¦ããã¾ããã)
rvm(Ruby Version Manager)ãªããã®ããã£ã¦ããããå
¥ããã°ç°¡åã«åãæ¿ããã§ããã¨ãããã¨ã§æ©éå
¥ãã¦ã¿ãã
便å©ãªã®ã§ã¿ãªãã¾ã«ã¯ãã²æåãã使ã£ã¦ã»ããã»ã»ã»ã
rvmã®ã¤ã³ã¹ãã¼ã«
Googleå çã«èãã¦ã¿ãã¨ãç°¡åã«åèãµã¤ããè¦ã¤ãã£ãã
Rubyãåé¤ãã
æ··ä¹±ããªãããã«ããã¾ã¾ã§ä½¿ã£ã¦ããRubyãåé¤ããã
$ sudo apt-get remove --purge ruby ruby1.8 ruby1.9.1 ruby1.9.1-dev rubygems rubygems1.8
curlã®ã¤ã³ã¹ãã¼ã«
$ sudo apt-get install curl
rvmã®ã¤ã³ã¹ãã¼ã«
ææ°ã®rvmãã¤ã³ã¹ãã¼ã«ããå ´åã¯ãä¸è¨ã®ã³ãã³ããå®è¡ããã
$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-latest )
â»æ³¨æâ»
2011å¹´2æ3æ¥ä»¥éã«ä¸è¨ã®æé ã§rvmãã¤ã³ã¹ãã¼ã«ãã¦ãruby1.8.7ãã¤ã³ã¹ãã¼ã«ããã¨ãgemã®ãã¼ã¸ã§ã³ã1.5.0ã«ãªã£ã¦ãã¾ã£ã¦ãRails2ããã¾ãåããªããªãã¾ãã(@sinsoku_listyãããããããªãã)
ä¸è¨ã®æ¹æ³ã§ããã°ãrvmã1.2.4ã«ãªã£ã¦ãrails2ãåãã¯ãã
$ mkdir -p ~/.rvm/src/ && cd ~/.rvm/src/ && curl -O http://rvm.beginrescueend.com/releases/rvm-1.2.4.tar.gz | tar zxf - && cd rvm-1.2.4 && ./install
rvmã®è¨å®ã.zshrcã«è¿½å
ä¸è¨ã®å 容ããã¡ã¤ã«ã®æ«å°¾ã«è¿½å ãã¦ãã·ã§ã«ãåèµ·åãã(sourceã§ãããããï¼)
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
rvmã³ãã³ãã確èª
ä¸è¨ã³ãã³ããå®è¡ããã¨ãrvmã®ä¾åããã±ã¼ã¸ã表示ãããã
$ rvm notes
ä¾åããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«
$ sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev
Rubyã®ã¤ã³ã¹ãã¼ã«
ããããRubyã®ã¤ã³ã¹ãã¼ã«ããããã¾ãã¯ã1.9.2ãããã³ã³ãã¤ã«ããã®ã§ãçµæ§æéãããã£ãã
$ rvm install 1.9.2
ãã£ãã使ã£ã¦ã¿ãããã¼ã¸ã§ã³ã表示ãããã°ãï½ã
$ rvm use 1.9.2 $ ruby -v
次ã¯ã1.8.7ã
$ rvm install 1.8.7
ã¾ã使ã£ã¦ã¿ãããã¼ã¸ã§ã³ã1.8.7ã¨è¡¨ç¤ºãããã°ãï½ã
$ rvm use 1.8.7 $ ruby -v
ããã©ã«ãã§ä½¿ãRubyãè¨å®ãã
æ¯å使ç¨ããRubyãè¨å®ããã®ã¯ããã©ããªã®ã§ãããã©ã«ãã§ä½¿ããã¼ã¸ã§ã³ã宣è¨ãã¦ããã
$ rvm use 1.9.2 --default
gemã使ã
rvmã§Rubyãã¤ã³ã¹ãã¼ã«ããã¨ãgemããã§ã«å ¥ã£ã¦ããããã¾ã¾ã§ä½¿ã£ã¦ããgemãå ¥ãç´ããgemããã¼ã ãã£ã¬ã¯ããªé ä¸ã«å ¥ãã®ã§ãroot権éã¯å¿ è¦ããã¾ã¸ãã
$ gem install rails