cygiwnã§rvmã使ã£ã¦ruby-1.9.2ããã«ã&ã¤ã³ã¹ãã¼ã«ãã
herokuã®ããã©ã«ãã®rubyã1.9.2ã«ãªãã¨ã®ãã¨ã§ãcygwinã«ãruby-1.9.2ãå
¥ãã¦ãããã¨ã«ãã¾ããã
ç´æ¥ã½ã¼ã¹ããã«ããã¦ã·ã¹ãã ã«å
¥ããã®ã§ã¯ãªããrvmã使ã£ã¦HOMEä¸ã«ã¤ã³ã¹ãã¼ã«ãã¾ããã
以ä¸ã¯ããã®æé ã§ãã
äºåæºå1: cygwinããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«
cygwinä¸ã«ä»¥ä¸ã®ããã±ã¼ã¸ãå ¥ã£ã¦ãªããã°å ¥ãã¾ããå½ç¶cygwinèªä½ãææ°çã«ãã¦ããã¾ãã(ä¸ããssl certã®æ´æ°ã§ä½¿ããã®ãããã«rvmã§å¿ è¦ãªãã®ãããã«rubyã®ãã«ãã§å¿ è¦ãªãã®ãã§ã)
- curl
- openssl
- ruby
- git
- patch
- gcc4
- mingw-win32api
- make
- openssl-devel
- libgdbm-devel
- zlib-devel
- tcltk
- bison
- autoconf
- m4
- libffi4
- libreadline7
- libopenssl098
- procps
- quilt
(ãããªããã®ã足ããªããã®ããããã)
äºåæºå2: cygwinã®SSLã«ã¼ã証ææ¸ã®ã¢ãããã¼ã
cygwinä»å±ã®ã«ã¼ãSSL証ææ¸ã¯å¤ãããã§ãgitãcurlãwgetã§rvmã®ãµã¤ããªã©ã¸httpsæ¥ç¶ãããã¨ããã¨å¤±æãã¦ãã¾ãã¾ãã
ããã§ã¾ããcygwinä¸ã®certãæ´æ°ããå¿
è¦ãããã¾ãã
git - SSL certificate rejected trying to access GitHub over HTTPS behind firewall - Stack Overflow ã®åçã«ããããæ¹ãã®ã¾ã¾ã§OKã§ããã
å
·ä½çã«ã¯ä»¥ä¸ã®3è¡ãå®è¡ãã¾ã:
cd /usr/ssl/certs curl http://curl.haxx.se/ca/cacert.pem | awk 'split_after==1{n++;split_after=0} /-----END CERTIFICATE-----/ {split_after=1} {print > "cert" n ".pem"}' c_rehash
rvmã®ã¤ã³ã¹ãã¼ã«ã¨ruby-1.9.2-headã®ãã«ã
äºåã«å¤ãrvmãã¼ã¿ã¯åé¤ãã¦ããã¾ãã
rm -rf ~/.rvm ~/.rvmrc
https://rvm.beginrescueend.com/ã«æ¸ãã¦ããæ¹æ³ã§rvmãå ¥ãã¾ãã
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
certãå¤ãã¾ã¾ãªãã°ããã§ä½ã表示ãããã«çµãã£ã¦ãã¾ãã¾ããcertãæ´æ°ããã¦ããã°gitçµç±ã§rvmããã¦ã³ãã¼ããã¦ããã¾ãã
次ã«rvmã使ã£ã¦ruby-1.9.2ãå ¥ãã¾ã:
source $HOME/.rvm/scripts/rvm rvm install 1.9.2-head -C "--enable-shared optflags='-O2 -march=native'"
certãå¤ãã£ãããcygwinããã±ã¼ã¸ã足ããªãã£ããããã¨ãã¦ã³ãã¼ãããã«ãã«å¤±æã赤ãæåãç»é¢ä¸ã«åºã¾ã(失æããªããã°ç·ãç½ã®æåã ãåºã¾ã)ã
ruby-1.9.2ã®ãã«ãã®ä»æ¹ã¯cygwinでrvm - akcnvの個人的備忘録 @ ウィキ - アットウィキã®ãã®ãåèã«ãã¦ãã¾ããä»ã®1.9.2-headã§ã¯LIBRARY_PATHã®è¨å®ã¯ä¸è¦ã®ããã§ãã(ã¡ãªã¿ã«1.8.7-headã®ã»ãã¯ãä¸è¨è¨äºã«ãã対çãåãå¿ è¦ãããã¾ããã)
ãã¨ãã«ãæéã¯çµæ§ãããã¾ã(5%ã¯ããã¯ã¢ããããASUS UL20Aã§1æéããã)ã
rvmã®ruby-1.9.2ããã¡ãã¨å ¥ã£ããã¨ã確èªãã
ãã«ãå¾ããã®ã¾ã¾ã³ãã³ã
rvm use 1.9.2-head
ãå®è¡ããã¨rubyã³ãã³ããgemã³ãã³ãããrvmä¸ã®ruby-1.9.2ã®ãã®ã使ãããã«ãªãã¾ãã
以ä¸ã®ãããªçµæã«ãªã£ã¦ããã°å ¥ã£ã¦ãããã¨ã«ãªãã¾ã:
$ ruby -v ruby 1.9.2p274 (2011-06-06 revision 31932) [i386-cygwin]
ã·ã¹ãã ã®rubyã³ãã³ãã«æ»ãå ´åã¯ã
rvm use system
ã§ãã
èµ·åæã«rvmã³ãã³ãã使ããããã«ãã
以ä¸ã®è¡ã~/.bashrcã~/.bash_profileçã«è¿½å ããã°ãã¿ã¼ããã«ãç«ã¡ä¸ããæç¹ã§rvmã³ãã³ãã使ããããã«ãªãã¾ãã以ä¸ã®è¡ã¯rvmã®ã¤ã³ã¹ãã¼ã©ã¼ãèªåã§è¿½å ããããã§ãã
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
ããã©ã«ãã®rubyãrvmã®rubyã«ãã
ä¸è¨ã®.bash_profileã«å ãã以ä¸ãå®è¡ãã¦ããã°ã次ã®ã¿ã¼ããã«èµ·åããã¯æåããrubyã³ãã³ããgemã³ãã³ãããrvmã®ruby-1.9.2ã®ãã®ã使ãããã«ãªãã¾ãã
rvm use 1.9.2-head --default
rvm gemsetã§gemç°å¢ãåãåããã
rvmã¯rubyã©ã³ã¿ã¤ã ã ãã§ãªããgemããã±ã¼ã¸ã®ç°å¢ãåãæ¿ãããã¨ãã§ãã¾ãããã¨ãã°ãwebã¢ããªããã¸ã§ã¯ããã¨ã«å¿ è¦ãªgemããã±ã¼ã¸ã ããæã£ãç°å¢ãä½ã£ã¦ãããã¨ã§ãããã¸ã§ã¯ããã¨ã«gemç°å¢ãåãæ¿ãã¦ä½¿ããã¨ãã§ãã¾ãã
gemç°å¢ã®ç®¡çã¯rvm useããç¶æ ã«å ¥ã£ã¦ãæã«rvm gemsetã³ãã³ãã使ã£ã¦è¡ãã¾ãã
gemç°å¢ä½æããã¨ãã°miniblogããã¸ã§ã¯ãã®ããã®"miniblog"ç°å¢ãä½ãå ´åã¯
rvm use 1.9.2-head rvm gemset create miniblog
ãå®è¡ãã¾ãã
次ã«ä½ã£ãgemç°å¢ã«åãæ¿ãã¾ãã
rvm gemset use miniblog
ãã®ç¶æ ã§ãã¨ã¯gemã³ãã³ãã§gem installãã¦ããã°è¯ãã§ãã
rvm useã³ãã³ãã§ä¸ç·ã«gemç°å¢ãåãæ¿ãããã¨ãå¯è½ã§ãã
rvm use 1.9.2-head@miniblog
ã¡ãªã¿ã«ããã©ã«ãã®gemç°å¢ã¯"global"ã§ãã
ãã¾ã: cygwinã§rvm install 1.8.7-headããæ¹æ³
ã¤ã³ã¹ãã¼ã«æ¹æ³
curl -O http://dl.dropbox.com/u/14499563/ruby-1.8.7-p348-cygwin/current-cygwin-has-own-setjmph.patch rvm install 1.8.7-head -C "--enable-shared optflags='-O2 -march=native'" --patch ./current-cygwin-has-own-setjmph.patch
解説
æ®éã«ãã«ããã¦å¤±æããã®ã¯ãcygwinããã§ã«setjmp.hãæã£ã¦ããã®ã«ãã½ã¼ã¹eval.cã¨gc.cä¸ã§ifdef __CYGWIN__å
ã§setjmp/longjmpã®ãããã¿ã¤ã宣è¨ããã¦ããããã§ã(ãããåãéã)ã
ãã®ããmakeã失æãããªãããã«ã¯ãåç´ã«ãã®å®£è¨é¨åãåé¤ããpatchãã¤ããã°ãããã¨ã«ãªãã¾ãã
patchã®ä½ãæ¹(ruby-1.8.7-p348ã®å ´å)
cd ~/.rvm/src/ruby-1.8.7-head/ ed eval.c <<EDIT 210,212d wq EDIT ed gc.c <<EDIT 42,44d wq EDIT git diff > ~/current-cygwin-has-own-setjmph.patch
ãã®patchã¯dropboxä¸ã«ããã¦ããã¾ãã
https://rvm.beginrescueend.com/rubies/patching/ã«ããã¨ã ".rvm/patches/ruby/1.8.7/"ã«ããpatchã¯èªåé©ç¨ããã¦ããããã§ãããã«ç½®ãããã«githubã§pull requestããã®ãè¯ãããã§ãã