{"id":995,"date":"2012-04-24T17:41:55","date_gmt":"2012-04-24T08:41:55","guid":{"rendered":"https:\/\/ecoop.net\/memo\/?p=995"},"modified":"2026-08-10T14:47:13","modified_gmt":"2026-08-10T05:47:13","slug":"rvm-usage-for-multi-rubies","status":"publish","type":"post","link":"https:\/\/www.ecoop.net\/memo\/archives\/rvm-usage-for-multi-rubies.html","title":{"rendered":"RVM\u3067Ruby\u74b0\u5883\u306e\u5207\u308a\u66ff\u3048\u3092\u7c21\u5358\u306b\uff01"},"content":{"rendered":"<p><a href=\"http:\/\/beginrescueend.com\/\"><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/www.ecoop.net\/memo\/wp-content\/uploads\/2012\/04\/rvm_image.png\" alt=\"Rvm image\" title=\"rvm_image.png\" border=\"0\" width=\"100%\"  \/><!--width=\"600\" height=\"278\"--><\/a><br \/>\nRuby \u958b\u767a\u3092\u59cb\u3081\u308b\u6642\u306f\u307e\u305agem\u7ba1\u7406\u30c4\u30fc\u30eb\u3092\u5165\u308c\u3066\u304a\u304f\u3068\u4fbf\u5229\u3067\u3059\u3002<br \/>\n\u5b9f\u884c\u74b0\u5883\u3084\u30d7\u30ed\u30c0\u30af\u30c8\u306b\u5fdc\u3058\u3001Ruby\u672c\u4f53\u3084gem\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u4f9d\u5b58\u3059\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u7570\u306a\u308b\u4e8b\u3082\u591a\u3005\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u7ba1\u7406\u3057\u3066\u5207\u308a\u66ff\u3048\u3092\u5bb9\u6613\u306b\u3057\u3066\u304f\u308c\u308b\u306e\u304cRVM(Ruby Version Manager)\u3084Bundler\u3068\u3044\u3063\u305f\u7ba1\u7406\u30c4\u30fc\u30eb\u306a\u306e\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306fRVM\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u3092\u307e\u3068\u3081\u307e\u3057\u305f\u3002\u305d\u308c\u3067\u306f\u7d9a\u304d\u3092\u3069\u3046\u305e\u3002<!--more--><\/p>\n<h2>rvm \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>gem install \u3067\u7c21\u5358\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ sudo gem install rvm\r\n$ source  ~\/.rvm\/scripts\/rvm\r\n$ cat &amp;lt;&amp;lt;_EOF_ ~\/.bashrc \r\n$ if &#x5B; -f  ~\/.rvm\/scripts\/rvm ];then\r\n\tsource  ~\/.rvm\/scripts\/rvm\r\nfi\r\n_EOF_\r\n<\/pre>\n<p>(\u65b9\u6cd52) github \u304b\u3089\u6700\u65b0\u7248\u3092\u5165\u308c\u308b\u4e8b\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ git clone git:\/\/github.com\/wayneeseguin\/rvm.git\r\n$ cd rvm\/\r\n$ .\/install \r\n$ source  ~\/.rvm\/scripts\/rvm\r\n$ cat &amp;lt;&amp;lt;_EOF_ ~\/.bashrc \r\n$ if &#x5B; -f  ~\/.rvm\/scripts\/rvm ];then\r\n\tsource  ~\/.rvm\/scripts\/rvm\r\nfi\r\n_EOF_\r\n<\/pre>\n<h2>rvm\u306bruby\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>\u307e\u305a\u306f\u3058\u3081\u306b\u958b\u767a\u306b\u4f7f\u3044\u305f\u3044 ruby \u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6c7a\u3081\u3001rvm \u5185\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002\u30b7\u30b9\u30c6\u30e0\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u306e ruby \u3068\u540c\u3058\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u958b\u767a\u3059\u308b\u5834\u5408\u3082\u3001\u3053\u3053\u3067\u65b0\u898f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ rvm install 1.9.2\r\n<\/pre>\n<h2>rvm \u306bgem\u7ba1\u7406\u30af\u3099\u30eb\u30fc\u30d5\u309a(gemset)\u3092\u4f5c\u6210<\/h2>\n<p>RVM\u3067\u306fRuby\u30d0\u30fc\u30b8\u30e7\u30f3\u30fb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3054\u3068\u306egem\u3092gemset\u3068\u3044\u3046\u5358\u4f4d\u3067\u7ba1\u7406\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u5148\u7a0b\u5165\u308c\u305fRuby 1.9.3\u3092\u4f7f\u3044hello_world\u3068\u3044\u3046\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306egemset\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ rvm use 1.9.2@hello_world --create\r\nUsing \/Users\/foo\/.rvm\/gems\/ruby-1.9.2-p318 with gemset hello_world\r\n<\/pre>\n<p>\u3053\u308c\u3067\u30b7\u30b9\u30c6\u30e0\u306b\u4f9d\u5b58\u3057\u306a\u3044Ruby\u958b\u767a\u74b0\u5883\u304c\u69cb\u7bc9\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2>RVM\u306b\u3088\u308b\u30cf\u3099\u30fc\u30b7\u3099\u30e7\u30f3\u5207\u308a\u66ff\u3048\u65b9\u6cd5<\/h2>\n<p>rvm use\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u5f8c\u3067 ruby &#8211;version \u3092\u5b9f\u884c\u3057\u3066\u307f\u308b\u3068\u3001\u4eca\u307e\u3067\u3068\u306f\u5225\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306eruby\u306b\u5207\u308a\u66ff\u308f\u3063\u3066\u3044\u308b\u4e8b\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u30ed\u30b0\u30a2\u30a6\u30c8\u3059\u308b\u3068\u5143\u306b\u623b\u308a\u307e\u3059\u304c\u3001\u4eca\u5f8c\u306f rvm use 1.9.3@hello_world \u3068\u3059\u308b\u3053\u3068\u3067\u3044\u3064\u3067\u3082\u74b0\u5883\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n## rvm use \u3092\u4f7f\u3063\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u5207\u308a\u66ff\u3048\u306e\u4f8b\r\n$ ruby --version\r\nruby 1.8.7 (2010-01-10 patchlevel 249) &#x5B;universal-darwin11.0]\r\n$ rvm use 1.9.3@hello_world\r\nUsing \/Users\/foo\/.rvm\/gems\/ruby-1.9.2-p318 with gemset hello_world\r\n$ ruby --version\r\nruby 1.9.2p318 (2012-02-14 revision 34678) &#x5B;x86_64-darwin11.3.0]\r\n<\/pre>\n<p>rvm use \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u3001gem\u3082\u30b7\u30b9\u30c6\u30e0\u306e\u3082\u306e\u304b\u3089\u5207\u308a\u66ff\u308f\u308a\u3001\u521d\u671f\u72b6\u614b\u306b\u306a\u3063\u3066\u3044\u307e\u3059(gemset\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408)\u3002<br \/>\nrails\u7b49\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5fc5\u8981\u306agem\u3092\u3053\u3053\u3067\u8ffd\u52a0\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ gem install rails \r\n$ gem install bundler thin i18n uglifier sass-rails coffee-rails\r\n<\/pre>\n<p>\u203b sudo\u3057\u3066<strong>\u3044\u306a\u3044<\/strong>\u3053\u3068\u306b\u6ce8\u610f\u3002\u5404\u30e6\u30fc\u30b6\u306e~\/.rvm\u4ee5\u4e0b\u3067gem\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081<strong>\u958b\u767a\u30e6\u30fc\u30b6\u3068\u3057\u3066<\/strong>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<h2>\u8a2d\u5b9a\u3092\u4fdd\u5b58\u3059\u308b<\/h2>\n<p>\u6b21\u56de\u4ee5\u964d\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u4f7f\u3063\u3066\u3044\u308bgemset\u3092\u81ea\u52d5\u3067\u8aad\u307f\u8fbc\u3080\u305f\u3081\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30eb\u30fc\u30c8\u306b.rvmrc\u3092\u4f5c\u6210\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ echo &quot;$ rvm use 1.9.2@hello_world&quot; &gt;&gt; .rvmrc\r\n<\/pre>\n<p>\u518d\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3068 rvm\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306b\u623b\u308a\u307e\u3059\u304c\u3001\u6b21\u306b\u30d1\u30c3\u30b1\u30fc\u30b8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u305f\u6642\u306b\u81ea\u52d5\u3067\u3053\u3053\u3067\u6307\u5b9a\u3057\u305fruby\u30d0\u30fc\u30b8\u30e7\u30f3,gemset\u306b\u5207\u308a\u66ff\u308f\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067\u5c0e\u5165\u5b8c\u4e86\u3067\u3059\u3002<br \/>\n\u8907\u6570\u4f5c\u6210\u3059\u308b\u5834\u5408\u3082\u540c\u69d8\u306e\u624b\u9806\u3067\u884c\u3048\u307e\u3059\u3002<\/p>\n<h2>RVM\u3067\u3088\u304f\u4f7f\u3046\u30b3\u30de\u30f3\u30c8\u3099<\/h2>\n<p>\u3053\u308c\u3067\u4f5c\u696d\u306f\u7d42\u308f\u308a\u3067\u3059\u304c\u3001\u53c2\u8003\u3068\u3057\u3066RVM\u3067\u3088\u304f\u4f7f\u3046\u30b3\u30de\u30f3\u30c9(\u30a2\u30af\u30b7\u30e7\u30f3)\u3092\u307e\u3068\u3081\u3066\u7d39\u4ecb\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\n<h3>rvm current<\/h3>\n<\/li>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrvm current\r\n<\/pre>\n<p>\u73fe\u5728\u9078\u629e\u4e2d\u306eRuby\u30d0\u30fc\u30b8\u30e7\u30f3,gemset\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<li>\n<h3>rvm list<\/h3>\n<\/li>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrvm list\r\n<\/pre>\n<p>\u73fe\u5728RVM\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308bruby\u30d0\u30fc\u30b8\u30e7\u30f3\u4e00\u89a7\u3092\u8868\u793a\u3057\u307e\u3059\u3002<br \/>\n\u9078\u629e\u4e2d\u306eruby\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u306f\u5370\u304c\u3064\u3044\u3066\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<li>\n<h3>rvm gemset list<\/h3>\n<\/li>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrvm gemset list\r\n<\/pre>\n<p>\u73fe\u5728RVM\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308bgemset\u4e00\u89a7\u3092\u8868\u793a\u3057\u307e\u3059\u3002<br \/>\n\u9078\u629e\u4e2d\u306egemset\u306b\u306f\u5370\u304c\u3064\u3044\u3066\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<li>\n<h3>rvm install<\/h3>\n<\/li>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrvm install &quot;Ruby\u30d0\u30fc\u30b8\u30e7\u30f3&quot;\r\n<\/pre>\n<p>RVM\u5185\u306bRuby\u672c\u4f53\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u65b0\u305f\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<li>\n<h3>rvm use<\/h3>\n<\/li>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrvm use &quot;Ruby\u30d0\u30fc\u30b8\u30e7\u30f3&quot;&#x5B;@&quot;gemset\u540d&quot;] &#x5B;--create]\r\n<\/pre>\n<p>\u4f7f\u7528\u3059\u308bRuby\u672c\u4f53\u30d0\u30fc\u30b8\u30e7\u30f3\u3068gemset\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002<br \/>\ngemset\u3092\u7701\u7565\u3057\u305f\u5834\u5408\u306fRuby\u672c\u4f53\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u307f\u5207\u308a\u66ff\u3048\u307e\u3059\u3002<br \/>\n &#8211;create\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3068\u3001gemset\u3068Ruby\u672c\u4f53\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u7d44\u307f\u5408\u308f\u305b\u304c\u5b58\u5728\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u306bgemset\u4f5c\u6210\u3092\u884c\u3044\u307e\u3059\u3002\u6307\u5b9a\u3057\u305fRuby\u672c\u4f53\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<li>\n<h3>rvm gemset use<\/h3>\n<\/li>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrvm gemset use &quot;gemset\u540d&quot;\r\n<\/pre>\n<p>\u4f7f\u7528\u3059\u308bgemset\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002<\/p>\n<li>\n<h3>rvm remove<\/h3>\n<\/li>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrvm remove &quot;Ruby\u30d0\u30fc\u30b8\u30e7\u30f3&quot;&#x5B;@&quot;gemset\u540d&quot;]\r\n<\/pre>\n<p>\u6307\u5b9a\u3057\u305fRuby\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u672c\u4f53,gemset\u3092RVM\u5185\u304b\u3089\u524a\u9664\u3057\u307e\u3059\u3002<br \/>\ngemset\u3092\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6307\u5b9a\u3057\u305fRuby\u672c\u4f53\u306e\u307f\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<li>\n<h3>rvm gemset delete<\/h3>\n<\/li>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrvm gemset delete &quot;gemset\u540d&quot;\r\n<\/pre>\n<p>\u6307\u5b9a\u3057\u305fgemset\u3092RVM\u5185\u304b\u3089\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<li>\n<h3>rvm help<\/h3>\n<\/li>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrvm help\r\n<\/pre>\n<p>RVM\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u30d8\u30eb\u30d7\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<li>\n<h3>rvm gemset help<\/h3>\n<\/li>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrvm gemset help\r\n<\/pre>\n<p>RVM\u306egemset\u7528\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u30d8\u30eb\u30d7\u3092\u8868\u793a\u3057\u307e\u3059\u3002\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Ruby \u958b\u767a\u3092\u59cb\u3081\u308b\u6642\u306f\u307e\u305agem\u7ba1\u7406\u30c4\u30fc\u30eb\u3092\u5165\u308c\u3066\u304a\u304f\u3068\u4fbf\u5229\u3067\u3059\u3002 \u5b9f\u884c\u74b0\u5883\u3084\u30d7\u30ed\u30c0\u30af\u30c8\u306b\u5fdc\u3058\u3001Ruby\u672c\u4f53\u3084gem\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u4f9d\u5b58\u3059\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u7570\u306a\u308b\u4e8b\u3082\u591a\u3005\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u7ba1\u7406\u3057\u3066\u5207\u308a\u66ff\u3048\u3092\u5bb9\u6613\u306b &hellip; <a href=\"https:\/\/www.ecoop.net\/memo\/archives\/rvm-usage-for-multi-rubies.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">RVM\u3067Ruby\u74b0\u5883\u306e\u5207\u308a\u66ff\u3048\u3092\u7c21\u5358\u306b\uff01<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1274,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[89,135],"tags":[15,96],"class_list":["post-995","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-dev","category-server","tag-ruby","tag-rvm"],"jetpack_featured_media_url":"https:\/\/www.ecoop.net\/memo\/wp-content\/uploads\/2017\/04\/rvm_image.png","_links":{"self":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/comments?post=995"}],"version-history":[{"count":1,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/995\/revisions"}],"predecessor-version":[{"id":1846,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/995\/revisions\/1846"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/media\/1274"}],"wp:attachment":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/media?parent=995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/categories?post=995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/tags?post=995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}