RVMã§Rails2ç°å¢ã¨Rails3ç°å¢ãå ±åããã
RVMã¨ãRubiesã¨ãBundlerã¨ãããããããã£ã¦è¨³ããããªããã©ã
ã¨ããããApache + RVM + Nginxãä¸çªæ¥½ããªã¨ããå°è±¡ã
ï¼Rails3ã¢ããªã管çããã®ã«Bundlerã使ããã©ï¼
ã
80çªãã¼ããåãä»ããã®ã¯Apacheã
ãã®Apacheããããã·ã«ãªã£ã¦ãå¾ãã®Nginxï¼80çªãã¼ã以å¤ã§èµ·åï¼ã«è»¢éããã
Rubyã¨Gemsetã®æ°ã ãNginxãèµ·åãããªãããããªããã©ãå¤åãããæå°ã
Nginxã使ããã«ã¹ã¿ã³ãã¢ãã¼ã³ã®Passengerã«ãããã·ã§æ¥ç¶ãã¦ãããããç¥ããªããã©ããã¼ãã®ç®¡çãé¢åã«ãªãããã ããNginxã使ã£ãã
ã
RVMãã¤ã³ã¹ãã¼ã«
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
ã
Ruby1.8.7ã¨Rails2.3ãã¤ã³ã¹ãã¼ã«
Nginxã®ã¤ã³ã¹ãã¼ã«ãã£ã¬ã¯ããªã¯ã
/usr/local/rvm/nginx/ruby-1.8.7-p358@rails23
ãæå®ããã
Rails2ãåããã«ã¯RubyGemsãæ°ãéããããããã¦ã³ã°ã¬ã¼ãããã
rvm install 1.8.7 rvm use 1.8.7 rvm gemset create rails23 rvm use 1.8.7@rails23 gem install rails -v 2.3.14 gem install passenger rvmsudo passenger-install-nginx-module gem update --system 1.6.2
ã
Ruby1.9.3ã¨Rails3.2ãã¤ã³ã¹ãã¼ã«
Nginxã®ã¤ã³ã¹ãã¼ã«ãã£ã¬ã¯ããªã¯ã
/usr/local/rvm/nginx/ruby-1.9.3-p125@rails32
ãæå®ããã
rvm install 1.9.3 rvm use 1.9.3 rvm gemset create rails32 rvm use 1.9.3@rails32 gem install rails gem install passenger rvmsudo passenger-install-nginx-module
ã
Nginxã®è¨å®
/usr/local/rvm/nginx/ruby-1.9.3-p125@rails32/conf/nginx.conf ãç·¨éã
passenger_rootã¨passenger_rubyã¯Rubyã¨Gemsetã®ãã¢ã«åãããã
è¤æ°ã®Nginxã§listenãããã¼ãã被ããªãããã«ããã
ä»åã¯8 + Rubyã®ãã¼ã¸ã§ã³ã¨ããã
http { passenger_root /usr/local/rvm/gems/ruby-1.9.3-p125@rails32/gems/passenger-3.0.11; passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.3-p125@rails32/ruby; server { listen 8193; server_name app1.example.com; root /somewhere/public; passenger_enabled on; } }
ã