{"id":235,"date":"2012-01-15T22:37:37","date_gmt":"2012-01-16T06:37:37","guid":{"rendered":"http:\/\/h2plus.biz\/hiromitsu\/?p=235"},"modified":"2018-08-06T13:42:13","modified_gmt":"2018-08-06T20:42:13","slug":"rvm%e3%81%a7rails%e3%81%ae%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%89","status":"publish","type":"post","link":"https:\/\/h2plus.biz\/hiromitsu\/entry\/235","title":{"rendered":"rvm\u3067Rails\u306e\u74b0\u5883\u69cb\u7bc9"},"content":{"rendered":"<p>Rails\u3069\u3053\u308d\u304bRuby\u81ea\u4f53\u307e\u3068\u3082\u306b\u8aad\u3093\u3060\u3053\u3068\u3082\u66f8\u3044\u305f\u3053\u3068\u3082\u306a\u3044\u304c\u3001\u5e74\u672b\u306e\u4f11\u307f\u306e\u9593\u306b<a href=\"https:\/\/www.railstutorial.org\/book\/beginning#cha-beginning\">Ruby on Rails Tutorial<\/a>\u3092\u898b\u3064\u3051\u3066\u3001\u6d41\u3057\u8aad\u307f\u3057\u3066\u3044\u308b\u3046\u3061\u306b\u300c\u3053\u308c\u306a\u3089\u672c\u5f53\u306b\u7c21\u5358\u306b\u3067\u304d\u305d\u3046\uff01\u300d\u306a\u6c17\u304c\u3057\u305f\u306e\u3067\u3001\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u6cbf\u3063\u3066\u624b\u3092\u52d5\u304b\u3057\u3066\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u3092\u66f8\u304d\u306a\u304c\u3089\u3001Ruby\u3068Rails\u3092\u7fd2\u5f97\u3057\u3088\u3046\u3068\u601d\u3044\u7acb\u3063\u305f\u3002<\/p>\n<p>\u624b\u59cb\u3081\u306b<a href=\"https:\/\/www.railstutorial.org\/book\/beginning#cha-beginning\">Chapter 1: From zero to deploy<\/a>\u3092\u8aad\u307f\u306a\u304c\u3089Rails\u306e\u74b0\u5883\u69cb\u7bc9\u3002\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u5fe0\u5b9f\u306b\u5b9f\u884c\u3057\u3066\u3044\u304f\u308f\u3051\u3067\u306f\u306a\u3044\u304c\u3001\u81ea\u5206\u3068\u540c\u3058\u3088\u3046\u306b\u30bc\u30ed\u30b9\u30bf\u30fc\u30c8\u3067Rails\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046\u3068\u3044\u3046\u4eba\u306e\u9053\u6a19\u306b\u306a\u308c\u3070\u3068\u3002<\/p>\n<p><!--more--><br \/>\nPHP\u3067ZF\u4f7f\u3063\u3066RESTful API\u3092\u66f8\u3044\u305f\u3053\u3068\u3082\u3042\u308b\u306e\u3067\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3068\u304bMVC\u3068\u304b\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u9762\u306f\u308f\u304b\u3063\u3066\u3044\u308b\u304c\u3001\u5192\u982d\u3067\u3082\u8a00\u3063\u305f\u3088\u3046\u306bRuby\u306b\u3064\u3044\u3066\u306f\u7121\u77e5\u3002\u307e\u3041\u6587\u6cd5\u7684\u306a\u3082\u306e\u306f\u7fd2\u3046\u3088\u308a\u6163\u308c\u308d\u3060\u306a\u3002<\/p>\n<p>Rails\u306e\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u306b\u306f\u3001Git\u3001Ruby\u3001RubyGems\u3001Rails\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u304f\u3053\u3068\u306b\u306a\u308b\u3002\u307e\u305a\u306fGit\u3060\u304c\u3001\u57fa\u672c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u304b\u3068\u3002\u5165\u3063\u3066\u306a\u304b\u3063\u305f\u3089<code>yum<\/code>\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u3002\u307e\u305f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u4e0a\u3067Git\u306e\u30b3\u30df\u30c3\u30c8\u5c65\u6b74\u3092\u95b2\u89a7\u3059\u308b\u306e\u306b\u4fbf\u5229\u306a<code>tig<\/code>\u3082\u3064\u3044\u3067\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u3053\u3046\u3002<\/p>\n<pre>\n$ sudo yum -y install git tig\n<\/pre>\n<p>Ruby\u306fOS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u5165\u308c\u305f\u304b\u3001<code>yum<\/code>\u3067\u5165\u308c\u305f\u304b\u5fd8\u308c\u305f\u304c\u3001\u3059\u3067\u306b1.8.7\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3060\u3063\u305f\u3002<\/p>\n<pre>\n$ ruby -v\nruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]\n<\/pre>\n<p>\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f1.9.2\u3092\u4f7f\u3046\u524d\u63d0\u306a\u306e\u3067\u3001\u307e\u305a\u306fRVM\uff08Ruby Version Manager\uff09\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304f\u3002<\/p>\n<pre>\n$ cd ~\n$ git clone git:\/\/github.com\/wayneeseguin\/rvm.git .rvm\n$ cd .rvm\n$ .\/install\n$ . scripts\/rvm\n$ rvm -v\nrvm 1.10.1 by Wayne E. Seguin &lt;wayneeseguin@gmail.com&gt;, Michal Papis &lt;mpapis@gmail.com&gt; [https:\/\/rvm.beginrescueend.com\/]\n<\/pre>\n<p>\u3061\u306a\u307f\u306b<code>~\/.rvm<\/code>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4e0b\u3067\u3001\u5148\u307b\u3069\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f<code>tig<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u30b3\u30df\u30c3\u30c8\u5c65\u6b74\u304c\u30ea\u30b9\u30c8\u8868\u793a\u3055\u308c\u308b\u3002<br \/>\n<img loading=\"lazy\" width=\"649\" height=\"531\" src=\"http:\/\/h2plus.biz\/hiromitsu\/wp-content\/uploads\/2012\/01\/tig-list.png\" alt=\"\" title=\"tig-list\" class=\"aligncenter size-full wp-image-250\" srcset=\"https:\/\/h2plus.biz\/hiromitsu\/wp-content\/uploads\/2012\/01\/tig-list.png 649w, https:\/\/h2plus.biz\/hiromitsu\/wp-content\/uploads\/2012\/01\/tig-list-300x245.png 300w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><br \/>\n\u30ea\u30b9\u30c8\u306e\u30ab\u30fc\u30bd\u30eb\u306f<code>vim<\/code>\u3068\u540c\u3058\u3088\u3046\u306b<code>j<\/code>\u3001<code>k<\/code>\u3067\u4e0a\u4e0b\u306b\u79fb\u52d5\u3067\u304d\u308b\u3002Enter\u3092\u62bc\u3059\u3068\u3001\u753b\u9762\u4e0b\u534a\u5206\u306b\u30b3\u30df\u30c3\u30c8\u306e\u8a73\u7d30\u304c<code>diff<\/code>\u5f62\u5f0f\u3067\u8868\u793a\u3055\u308c\u308b\u3002<br \/>\n<img loading=\"lazy\" width=\"649\" height=\"531\" src=\"http:\/\/h2plus.biz\/hiromitsu\/wp-content\/uploads\/2012\/01\/tig-detail.png\" alt=\"\" title=\"tig-detail\" class=\"aligncenter size-full wp-image-251\" srcset=\"https:\/\/h2plus.biz\/hiromitsu\/wp-content\/uploads\/2012\/01\/tig-detail.png 649w, https:\/\/h2plus.biz\/hiromitsu\/wp-content\/uploads\/2012\/01\/tig-detail-300x245.png 300w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><br \/>\n<code>q<\/code>\u30671\u3064\u305a\u3064\u623b\u3063\u3066\u3001\u6700\u5f8c\u306f<code>tig<\/code>\u30b3\u30de\u30f3\u30c9\u304b\u3089\u629c\u3051\u308b\u3002Web\u4e0a\u3067\u898b\u308b\u3088\u308a\u65e9\u304f\u3066\u4fbf\u5229\u3002<\/p>\n<p>\u3055\u3066\u3001\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f1.9.2\u3092\u4f7f\u3046\u524d\u63d0\u306a\u306e\u3067\u3001<code>rvm<\/code>\u7d4c\u7531\u30671.9.2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre>\n$ rvm install 1.9.2\n$ rvm --create use 1.9.2@rails3\n$ ruby -v\nruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]\n$ gem -v\n1.8.10\n<\/pre>\n<p><a href=\"http:\/\/h2plus.biz\/hiromitsu\/entry\/154\">nvm\u3067node.js\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/a>\u306e\u3068\u540c\u3058\u611f\u3058\uff08rvm\u304c\u672c\u5bb6\uff09\u3002<\/p>\n<p>\u7d9a\u3044\u3066Rails\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f3.0.11\u3068\u30d0\u30fc\u30b8\u30e7\u30f3\u6307\u5b9a\u305b\u3088\u3068\u3002<\/p>\n<pre>\n$ gem install rails --version 3.0.11\n...\nSuccessfully installed activesupport-3.0.11\nSuccessfully installed builder-2.1.2\nSuccessfully installed i18n-0.5.0\nSuccessfully installed activemodel-3.0.11\nSuccessfully installed rack-1.2.5\nSuccessfully installed rack-test-0.5.7\nSuccessfully installed rack-mount-0.6.14\nSuccessfully installed tzinfo-0.3.31\nSuccessfully installed abstract-1.0.0\nSuccessfully installed erubis-2.6.6\nSuccessfully installed actionpack-3.0.11\nSuccessfully installed arel-2.0.10\nSuccessfully installed activerecord-3.0.11\nSuccessfully installed activeresource-3.0.11\nSuccessfully installed mime-types-1.17.2\nSuccessfully installed polyglot-0.3.3\nSuccessfully installed treetop-1.4.10\nSuccessfully installed mail-2.2.19\nSuccessfully installed actionmailer-3.0.11\nSuccessfully installed rake-0.9.2.2\nSuccessfully installed thor-0.14.6\nSuccessfully installed json-1.6.4\nSuccessfully installed rdoc-3.12\nSuccessfully installed railties-3.0.11\nSuccessfully installed rails-3.0.11\n25 gems installed\n...\n$ rails -v\nRails 3.0.11\n<\/pre>\n<p>Rails\u304c\u4f9d\u5b58\u3057\u3066\u3044\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3082\u305e\u308d\u305e\u308d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u306e\u304c\u308f\u304b\u308b\u3002<\/p>\n<p>\u6700\u5f8c\u306b<code>~\/.bashrc<\/code>\u3092\u7de8\u96c6\u3057\u3066\u30b7\u30a7\u30eb\u74b0\u5883\u3067\u3001RVM\u3001Ruby\u3001Rails\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u3053\u3046\u3002<\/p>\n<p><code>~\/.bashrc<\/code>\u306e\u6700\u5f8c\u306e\u884c\u306b\u3042\u308b<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n[[ -s &amp;amp;amp;quot;$HOME\/.rvm\/scripts\/rvm&amp;amp;amp;quot; ]] &amp;amp;amp;amp;&amp;amp;amp;amp; source &amp;amp;amp;quot;$HOME\/.rvm\/scripts\/rvm&amp;amp;amp;quot; # Load RVM into a shell session *as a function*\r\n<\/pre>\n<p>\u3068\u3044\u3046\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3001RVM\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u8ffd\u52a0\u3055\u308c\u305f\u3082\u306e\u3060\u304c\u3001\u3053\u306e\u884c\u3092\u524a\u9664\u3057\u3066\u4ee3\u308f\u308a\u306b<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nif [ &amp;amp;amp;quot;$TERM&amp;amp;amp;quot; = &amp;amp;amp;quot;xterm&amp;amp;amp;quot; ]; then\r\n    # Enable rvm (Ruby Version Manager)\r\n    if [ -s ~\/.rvm\/scripts\/rvm ]; then\r\n        . ~\/.rvm\/scripts\/rvm\r\n        rvm use 1.9.2@rails3 &amp;amp;amp;gt; \/dev\/null\r\n    fi\r\nfi\r\n<\/pre>\n<p>\u3068\u66f8\u3044\u3066\u304a\u304f\u3002<\/p>\n<p>\u3053\u308c\u3067Rails\u3067\u306e\u958b\u767a\u74b0\u5883\u306f\u6574\u3063\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rails\u3069\u3053\u308d\u304bRuby\u81ea\u4f53\u307e\u3068\u3082\u306b\u8aad\u3093\u3060\u3053\u3068\u3082\u66f8\u3044\u305f\u3053\u3068\u3082\u306a\u3044\u304c\u3001\u5e74\u672b\u306e\u4f11\u307f\u306e\u9593\u306bRuby on Rails Tutorial\u3092\u898b\u3064\u3051\u3066\u3001\u6d41\u3057\u8aad\u307f\u3057\u3066\u3044\u308b\u3046\u3061\u306b\u300c\u3053\u308c\u306a\u3089\u672c\u5f53\u306b\u7c21\u5358\u306b\u3067\u304d\u305d\u3046\uff01\u300d\u306a\u6c17\u304c\u3057\u305f\u306e\u3067\u3001\u30c1\u30e5\u30fc <a href='https:\/\/h2plus.biz\/hiromitsu\/entry\/235' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[129],"tags":[126,275,274,130,133,131,134,132],"_links":{"self":[{"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/posts\/235"}],"collection":[{"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/comments?post=235"}],"version-history":[{"count":0,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/posts\/235\/revisions"}],"wp:attachment":[{"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/media?parent=235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/categories?post=235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/tags?post=235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}