Skip to content
This repository
Browse code

Site updated at 2012-04-21 10:02:28 UTC

  • Loading branch information...
commit 3d050a46d286fa046eb761914aceddf0835dd9fa 1 parent ee56e45
Ryan Wang authored April 21, 2012
103  atom.xml
@@ -4,7 +4,7 @@
4 4
   <title><![CDATA[Wongyouth's Blog]]></title>
5 5
   <link href="http://wongyouth.github.com/atom.xml" rel="self"/>
6 6
   <link href="http://wongyouth.github.com/"/>
7  
-  <updated>2012-04-21T17:57:55+08:00</updated>
  7
+  <updated>2012-04-21T18:01:40+08:00</updated>
8 8
   <id>http://wongyouth.github.com/</id>
9 9
   <author>
10 10
     <name><![CDATA[Wongyouth]]></name>
@@ -13,4 +13,105 @@
13 13
   <generator uri="http://octopress.org/">Octopress</generator>
14 14
 
15 15
   
  16
+  <entry>
  17
+    <title type="html"><![CDATA[Ubuntu下安装ruby开发环境]]></title>
  18
+    <link href="http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu/"/>
  19
+    <updated>2012-04-21T14:41:00+08:00</updated>
  20
+    <id>http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu</id>
  21
+    <content type="html"><![CDATA[<p>开始的时候我也是用Windows作为Rails项目开发的。
  22
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
  23
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。</p>
  24
+
  25
+<p>使用Ubuntu有个好处,每天跟Ubuntu打交道会提高整体的服务器排错水平,因为每天用的就是服务器一样的环境,遇到问题每天都要去解决,久而久之水平也就上去了。</p>
  26
+
  27
+<p>闲话休提。让我们看看如何设置ruby环境吧。</p>
  28
+
  29
+<ol>
  30
+<li>预安装库文件</li>
  31
+<li>安装<code>rbenv</code></li>
  32
+<li>下载并编译<code>ruby</code></li>
  33
+<li>创建第一个<code>Rails</code>项目</li>
  34
+</ol>
  35
+
  36
+
  37
+<h2>安装<code>rbenv-installer</code></h2>
  38
+
  39
+<h4>预安装一些编译时用到的库文件和工具</h4>
  40
+
  41
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  42
+<span class='line-number'>2</span>
  43
+<span class='line-number'>3</span>
  44
+<span class='line-number'>4</span>
  45
+<span class='line-number'>5</span>
  46
+<span class='line-number'>6</span>
  47
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>sudo apt-get -y install git-core curl <span class="se">\</span>
  48
+</span><span class='line'>build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev <span class="se">\</span>
  49
+</span><span class='line'>zlib1g zlib1g-dev libssl-dev libyaml-dev <span class="se">\</span>
  50
+</span><span class='line'>libsqlite3-0 libsqlite3-dev sqlite3 <span class="se">\</span>
  51
+</span><span class='line'>libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake <span class="se">\</span>
  52
+</span><span class='line'>libtool bison subversion libxslt1-dev
  53
+</span></code></pre></td></tr></table></div></figure>
  54
+
  55
+
  56
+<p>如果使用jruby的话,安装一个jdk环境</p>
  57
+
  58
+<pre><code>sudo apt-get install default-jdk
  59
+</code></pre>
  60
+
  61
+<h2>安装<code>rbenv</code></h2>
  62
+
  63
+<p>我使用<a href="https://github.com/sstephenson/rbenv">rbenv</a>而不是rvm来作为ruby的版本管理软件。理由在rbenv的项目页面说明的很清楚了,更安全也更简单</p>
  64
+
  65
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  66
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
  67
+</span></code></pre></td></tr></table></div></figure>
  68
+
  69
+
  70
+<h2>下载并编译<code>ruby</code></h2>
  71
+
  72
+<p>假设你使用ruby-1.9.3</p>
  73
+
  74
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  75
+<span class='line-number'>2</span>
  76
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>rbenv install 1.9.3-p125
  77
+</span><span class='line'>rbenv global 1.9.3-p125
  78
+</span></code></pre></td></tr></table></div></figure>
  79
+
  80
+
  81
+<p>查看可以安装的ruby版本列表</p>
  82
+
  83
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  84
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>  rbenv versions
  85
+</span></code></pre></td></tr></table></div></figure>
  86
+
  87
+
  88
+<p>查看当前的ruby版本</p>
  89
+
  90
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  91
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>  rbenv version
  92
+</span></code></pre></td></tr></table></div></figure>
  93
+
  94
+
  95
+<p>更新rbenv里的链接指向gems的可执行文件的映射,安装了新的gem包时记得刷新。</p>
  96
+
  97
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  98
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>  rbenv rehash
  99
+</span></code></pre></td></tr></table></div></figure>
  100
+
  101
+
  102
+<h2>创建第一个<code>Rails</code>项目</h2>
  103
+
  104
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  105
+<span class='line-number'>2</span>
  106
+<span class='line-number'>3</span>
  107
+<span class='line-number'>4</span>
  108
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>  gem update --system
  109
+</span><span class='line'>  gem install bundler rails
  110
+</span><span class='line'>  rbenv rehash
  111
+</span><span class='line'>  rails new blog
  112
+</span></code></pre></td></tr></table></div></figure>
  113
+
  114
+]]></content>
  115
+  </entry>
  116
+  
16 117
 </feed>
293  blog/2012/04/21/install-ruby-environment-on-ubuntu/index.html
... ...
@@ -0,0 +1,293 @@
  1
+
  2
+<!DOCTYPE html>
  3
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
  4
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
  5
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
  6
+<head>
  7
+  <meta charset="utf-8">
  8
+  <title>Ubuntu下安装ruby开发环境 - Wongyouth's Blog</title>
  9
+  <meta name="author" content="Wongyouth">
  10
+
  11
+  
  12
+  <meta name="description" content="开始的时候我也是用Windows作为Rails项目开发的。
  13
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
  14
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。 使用Ubuntu有个好处, &hellip;">
  15
+  
  16
+
  17
+  <!-- http://t.co/dKP3o1e -->
  18
+  <meta name="HandheldFriendly" content="True">
  19
+  <meta name="MobileOptimized" content="320">
  20
+  <meta name="viewport" content="width=device-width, initial-scale=1">
  21
+
  22
+  
  23
+  <link rel="canonical" href="http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu">
  24
+  <link href="/favicon.png" rel="icon">
  25
+  <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
  26
+  <script src="/javascripts/modernizr-2.0.js"></script>
  27
+  <script src="/javascripts/ender.js"></script>
  28
+  <script src="/javascripts/octopress.js" type="text/javascript"></script>
  29
+  <link href="/atom.xml" rel="alternate" title="Wongyouth's Blog" type="application/atom+xml">
  30
+  <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
  31
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
  32
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
  33
+
  34
+  
  35
+
  36
+</head>
  37
+
  38
+<body   >
  39
+  <header role="banner"><hgroup>
  40
+  <h1><a href="/">Wongyouth's Blog</a></h1>
  41
+  
  42
+    <h2>Do things the stupid way.</h2>
  43
+  
  44
+</hgroup>
  45
+
  46
+</header>
  47
+  <nav role="navigation"><ul class="subscription" data-subscription="rss">
  48
+  <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
  49
+  
  50
+</ul>
  51
+  
  52
+<form action="http://google.com/search" method="get">
  53
+  <fieldset role="search">
  54
+    <input type="hidden" name="q" value="site:wongyouth.github.com" />
  55
+    <input class="search" type="text" name="q" results="0" placeholder="Search"/>
  56
+  </fieldset>
  57
+</form>
  58
+  
  59
+<ul class="main-navigation">
  60
+  <li><a href="/">Blog</a></li>
  61
+  <li><a href="/blog/archives">Archives</a></li>
  62
+</ul>
  63
+
  64
+</nav>
  65
+  <div id="main">
  66
+    <div id="content">
  67
+      <div>
  68
+<article class="hentry" role="article">
  69
+  
  70
+  <header>
  71
+    
  72
+      <h1 class="entry-title">Ubuntu下安装ruby开发环境</h1>
  73
+    
  74
+    
  75
+      <p class="meta">
  76
+        
  77
+
  78
+
  79
+
  80
+
  81
+
  82
+
  83
+
  84
+
  85
+  
  86
+
  87
+
  88
+<time datetime="2012-04-21T14:41:00+08:00" pubdate data-updated="true">2012-04-21</time>
  89
+        
  90
+      </p>
  91
+    
  92
+  </header>
  93
+
  94
+
  95
+<div class="entry-content"><p>开始的时候我也是用Windows作为Rails项目开发的。
  96
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
  97
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。</p>
  98
+
  99
+<p>使用Ubuntu有个好处,每天跟Ubuntu打交道会提高整体的服务器排错水平,因为每天用的就是服务器一样的环境,遇到问题每天都要去解决,久而久之水平也就上去了。</p>
  100
+
  101
+<p>闲话休提。让我们看看如何设置ruby环境吧。</p>
  102
+
  103
+<ol>
  104
+<li>预安装库文件</li>
  105
+<li>安装<code>rbenv</code></li>
  106
+<li>下载并编译<code>ruby</code></li>
  107
+<li>创建第一个<code>Rails</code>项目</li>
  108
+</ol>
  109
+
  110
+
  111
+<h2>安装<code>rbenv-installer</code></h2>
  112
+
  113
+<h4>预安装一些编译时用到的库文件和工具</h4>
  114
+
  115
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  116
+<span class='line-number'>2</span>
  117
+<span class='line-number'>3</span>
  118
+<span class='line-number'>4</span>
  119
+<span class='line-number'>5</span>
  120
+<span class='line-number'>6</span>
  121
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>sudo apt-get -y install git-core curl <span class="se">\</span>
  122
+</span><span class='line'>build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev <span class="se">\</span>
  123
+</span><span class='line'>zlib1g zlib1g-dev libssl-dev libyaml-dev <span class="se">\</span>
  124
+</span><span class='line'>libsqlite3-0 libsqlite3-dev sqlite3 <span class="se">\</span>
  125
+</span><span class='line'>libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake <span class="se">\</span>
  126
+</span><span class='line'>libtool bison subversion libxslt1-dev
  127
+</span></code></pre></td></tr></table></div></figure>
  128
+
  129
+
  130
+<p>如果使用jruby的话,安装一个jdk环境</p>
  131
+
  132
+<pre><code>sudo apt-get install default-jdk
  133
+</code></pre>
  134
+
  135
+<h2>安装<code>rbenv</code></h2>
  136
+
  137
+<p>我使用<a href="https://github.com/sstephenson/rbenv">rbenv</a>而不是rvm来作为ruby的版本管理软件。理由在rbenv的项目页面说明的很清楚了,更安全也更简单</p>
  138
+
  139
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  140
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
  141
+</span></code></pre></td></tr></table></div></figure>
  142
+
  143
+
  144
+<h2>下载并编译<code>ruby</code></h2>
  145
+
  146
+<p>假设你使用ruby-1.9.3</p>
  147
+
  148
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  149
+<span class='line-number'>2</span>
  150
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>rbenv install 1.9.3-p125
  151
+</span><span class='line'>rbenv global 1.9.3-p125
  152
+</span></code></pre></td></tr></table></div></figure>
  153
+
  154
+
  155
+<p>查看可以安装的ruby版本列表</p>
  156
+
  157
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  158
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>  rbenv versions
  159
+</span></code></pre></td></tr></table></div></figure>
  160
+
  161
+
  162
+<p>查看当前的ruby版本</p>
  163
+
  164
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  165
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>  rbenv version
  166
+</span></code></pre></td></tr></table></div></figure>
  167
+
  168
+
  169
+<p>更新rbenv里的链接指向gems的可执行文件的映射,安装了新的gem包时记得刷新。</p>
  170
+
  171
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  172
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>  rbenv rehash
  173
+</span></code></pre></td></tr></table></div></figure>
  174
+
  175
+
  176
+<h2>创建第一个<code>Rails</code>项目</h2>
  177
+
  178
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  179
+<span class='line-number'>2</span>
  180
+<span class='line-number'>3</span>
  181
+<span class='line-number'>4</span>
  182
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>  gem update --system
  183
+</span><span class='line'>  gem install bundler rails
  184
+</span><span class='line'>  rbenv rehash
  185
+</span><span class='line'>  rails new blog
  186
+</span></code></pre></td></tr></table></div></figure>
  187
+
  188
+</div>
  189
+
  190
+
  191
+  <footer>
  192
+    <p class="meta">
  193
+      
  194
+  
  195
+
  196
+<span class="byline author vcard">Posted by <span class="fn">Wongyouth</span></span>
  197
+
  198
+      
  199
+
  200
+
  201
+
  202
+
  203
+
  204
+
  205
+
  206
+
  207
+  
  208
+
  209
+
  210
+<time datetime="2012-04-21T14:41:00+08:00" pubdate data-updated="true">2012-04-21</time>
  211
+      
  212
+
  213
+<span class="categories">
  214
+  
  215
+    <a class='category' href='/blog/categories/ruby/'>ruby</a>, <a class='category' href='/blog/categories/ubuntu/'>ubuntu</a>
  216
+  
  217
+</span>
  218
+
  219
+
  220
+    </p>
  221
+    
  222
+      <div class="sharing">
  223
+  
  224
+  <a href="http://twitter.com/share" class="twitter-share-button" data-url="http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu/" data-via="" data-counturl="http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu/" >Tweet</a>
  225
+  
  226
+  
  227
+  
  228
+</div>
  229
+
  230
+    
  231
+    <p class="meta">
  232
+      
  233
+      
  234
+    </p>
  235
+  </footer>
  236
+</article>
  237
+
  238
+</div>
  239
+
  240
+<aside class="sidebar">
  241
+  
  242
+    <section>
  243
+  <h1>Recent Posts</h1>
  244
+  <ul id="recent_posts">
  245
+    
  246
+      <li class="post">
  247
+        <a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a>
  248
+      </li>
  249
+    
  250
+  </ul>
  251
+</section>
  252
+
  253
+
  254
+
  255
+
  256
+
  257
+
  258
+  
  259
+</aside>
  260
+
  261
+
  262
+    </div>
  263
+  </div>
  264
+  <footer role="contentinfo"><p>
  265
+  Copyright &copy; 2012 - Wongyouth -
  266
+  <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
  267
+</p>
  268
+
  269
+</footer>
  270
+  
  271
+
  272
+
  273
+
  274
+
  275
+
  276
+
  277
+
  278
+  <script type="text/javascript">
  279
+    (function(){
  280
+      var twitterWidgets = document.createElement('script');
  281
+      twitterWidgets.type = 'text/javascript';
  282
+      twitterWidgets.async = true;
  283
+      twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
  284
+      document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
  285
+    })();
  286
+  </script>
  287
+
  288
+
  289
+
  290
+
  291
+
  292
+</body>
  293
+</html>
24  blog/archives/index.html
@@ -9,7 +9,8 @@
9 9
   <meta name="author" content="Wongyouth">
10 10
 
11 11
   
12  
-  <meta name="description" content=" Blog Archive Recent Posts ">
  12
+  <meta name="description" content=" Blog Archive 2012 Ubuntu下安装ruby开发环境
  13
+Apr 21 2012 posted in ruby, ubuntu Recent Posts Ubuntu下安装ruby开发环境 ">
13 14
   
14 15
 
15 16
   <!-- http://t.co/dKP3o1e -->
@@ -72,6 +73,23 @@ <h1 class="entry-title">Blog Archive</h1>
72 73
   
73 74
   <div id="blog-archives">
74 75
 
  76
+
  77
+
  78
+  
  79
+  <h2>2012</h2>
  80
+
  81
+<article>
  82
+  
  83
+<h1><a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a></h1>
  84
+<time datetime="2012-04-21T14:41:00+08:00" pubdate><span class='month'>Apr</span> <span class='day'>21</span> <span class='year'>2012</span></time>
  85
+
  86
+<footer>
  87
+  <span class="categories">posted in <a class='category' href='/blog/categories/ruby/'>ruby</a>, <a class='category' href='/blog/categories/ubuntu/'>ubuntu</a></span>
  88
+</footer>
  89
+
  90
+
  91
+</article>
  92
+
75 93
 </div>
76 94
 
77 95
   
@@ -85,6 +103,10 @@ <h1 class="entry-title">Blog Archive</h1>
85 103
   <h1>Recent Posts</h1>
86 104
   <ul id="recent_posts">
87 105
     
  106
+      <li class="post">
  107
+        <a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a>
  108
+      </li>
  109
+    
88 110
   </ul>
89 111
 </section>
90 112
 
101  blog/categories/ruby/atom.xml
... ...
@@ -0,0 +1,101 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<feed xmlns="http://www.w3.org/2005/Atom">
  3
+
  4
+  <title><![CDATA[Category: ruby | Wongyouth's Blog]]></title>
  5
+  <link href="http://wongyouth.github.com/blog/categories/ruby/atom.xml" rel="self"/>
  6
+  <link href="http://wongyouth.github.com/"/>
  7
+  <updated>2012-04-21T18:01:40+08:00</updated>
  8
+  <id>http://wongyouth.github.com/</id>
  9
+  <author>
  10
+    <name><![CDATA[Wongyouth]]></name>
  11
+    
  12
+  </author>
  13
+  <generator uri="http://octopress.org/">Octopress</generator>
  14
+
  15
+  
  16
+  <entry>
  17
+    <title type="html"><![CDATA[Ubuntu下安装ruby开发环境]]></title>
  18
+    <link href="http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu/"/>
  19
+    <updated>2012-04-21T14:41:00+08:00</updated>
  20
+    <id>http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu</id>
  21
+    <content type="html"><![CDATA[<p>开始的时候我也是用Windows作为Rails项目开发的。
  22
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
  23
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。</p>
  24
+
  25
+<p>使用Ubuntu有个好处,每天跟Ubuntu打交道会提高整体的服务器排错水平,因为每天用的就是服务器一样的环境,遇到问题每天都要去解决,久而久之水平也就上去了。</p>
  26
+
  27
+<p>闲话休提。让我们看看如何设置ruby环境吧。</p>
  28
+
  29
+<ol>
  30
+<li>预安装库文件</li>
  31
+<li>安装<code>rbenv</code></li>
  32
+<li>下载并编译<code>ruby</code></li>
  33
+<li>创建第一个<code>Rails</code>项目</li>
  34
+</ol>
  35
+
  36
+
  37
+<h2>安装<code>rbenv-installer</code></h2>
  38
+
  39
+<h4>预安装一些编译时用到的库文件和工具</h4>
  40
+
  41
+<p><code>sh
  42
+sudo apt-get -y install git-core curl \
  43
+build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev \
  44
+zlib1g zlib1g-dev libssl-dev libyaml-dev \
  45
+libsqlite3-0 libsqlite3-dev sqlite3 \
  46
+libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake \
  47
+libtool bison subversion libxslt1-dev
  48
+</code></p>
  49
+
  50
+<p>如果使用jruby的话,安装一个jdk环境</p>
  51
+
  52
+<pre><code>sudo apt-get install default-jdk
  53
+</code></pre>
  54
+
  55
+<h2>安装<code>rbenv</code></h2>
  56
+
  57
+<p>我使用<a href="https://github.com/sstephenson/rbenv">rbenv</a>而不是rvm来作为ruby的版本管理软件。理由在rbenv的项目页面说明的很清楚了,更安全也更简单</p>
  58
+
  59
+<p><code>sh
  60
+curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
  61
+</code></p>
  62
+
  63
+<h2>下载并编译<code>ruby</code></h2>
  64
+
  65
+<p>假设你使用ruby-1.9.3</p>
  66
+
  67
+<p><code>sh
  68
+rbenv install 1.9.3-p125
  69
+rbenv global 1.9.3-p125
  70
+</code></p>
  71
+
  72
+<p>查看可以安装的ruby版本列表</p>
  73
+
  74
+<p><code>sh
  75
+  rbenv versions
  76
+</code></p>
  77
+
  78
+<p>查看当前的ruby版本</p>
  79
+
  80
+<p><code>sh
  81
+  rbenv version
  82
+</code></p>
  83
+
  84
+<p>更新rbenv里的链接指向gems的可执行文件的映射,安装了新的gem包时记得刷新。</p>
  85
+
  86
+<p><code>sh
  87
+  rbenv rehash
  88
+</code></p>
  89
+
  90
+<h2>创建第一个<code>Rails</code>项目</h2>
  91
+
  92
+<p><code>sh
  93
+  gem update --system
  94
+  gem install bundler rails
  95
+  rbenv rehash
  96
+  rails new blog
  97
+</code></p>
  98
+]]></content>
  99
+  </entry>
  100
+  
  101
+</feed>
152  blog/categories/ruby/index.html
... ...
@@ -0,0 +1,152 @@
  1
+
  2
+<!DOCTYPE html>
  3
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
  4
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
  5
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
  6
+<head>
  7
+  <meta charset="utf-8">
  8
+  <title>Category: ruby - Wongyouth's Blog</title>
  9
+  <meta name="author" content="Wongyouth">
  10
+
  11
+  
  12
+  <meta name="description" content="Category: ruby">
  13
+  
  14
+
  15
+  <!-- http://t.co/dKP3o1e -->
  16
+  <meta name="HandheldFriendly" content="True">
  17
+  <meta name="MobileOptimized" content="320">
  18
+  <meta name="viewport" content="width=device-width, initial-scale=1">
  19
+
  20
+  
  21
+  <link rel="canonical" href="http://wongyouth.github.comblog/categories/ruby">
  22
+  <link href="/favicon.png" rel="icon">
  23
+  <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
  24
+  <script src="/javascripts/modernizr-2.0.js"></script>
  25
+  <script src="/javascripts/ender.js"></script>
  26
+  <script src="/javascripts/octopress.js" type="text/javascript"></script>
  27
+  <link href="/atom.xml" rel="alternate" title="Wongyouth's Blog" type="application/atom+xml">
  28
+  <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
  29
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
  30
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
  31
+
  32
+  
  33
+
  34
+</head>
  35
+
  36
+<body   >
  37
+  <header role="banner"><hgroup>
  38
+  <h1><a href="/">Wongyouth's Blog</a></h1>
  39
+  
  40
+    <h2>Do things the stupid way.</h2>
  41
+  
  42
+</hgroup>
  43
+
  44
+</header>
  45
+  <nav role="navigation"><ul class="subscription" data-subscription="rss">
  46
+  <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
  47
+  
  48
+</ul>
  49
+  
  50
+<form action="http://google.com/search" method="get">
  51
+  <fieldset role="search">
  52
+    <input type="hidden" name="q" value="site:wongyouth.github.com" />
  53
+    <input class="search" type="text" name="q" results="0" placeholder="Search"/>
  54
+  </fieldset>
  55
+</form>
  56
+  
  57
+<ul class="main-navigation">
  58
+  <li><a href="/">Blog</a></li>
  59
+  <li><a href="/blog/archives">Archives</a></li>
  60
+</ul>
  61
+
  62
+</nav>
  63
+  <div id="main">
  64
+    <div id="content">
  65
+      <div>
  66
+<article role="article">
  67
+  
  68
+  <header>
  69
+    <h1 class="entry-title">Category: Ruby</h1>
  70
+    
  71
+  </header>
  72
+  
  73
+  <div id="blog-archives" class="category">
  74
+
  75
+
  76
+
  77
+  
  78
+  <h2>2012</h2>
  79
+
  80
+<article>
  81
+  
  82
+<h1><a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a></h1>
  83
+<time datetime="2012-04-21T14:41:00+08:00" pubdate><span class='month'>Apr</span> <span class='day'>21</span> <span class='year'>2012</span></time>
  84
+
  85
+<footer>
  86
+  <span class="categories">posted in <a class='category' href='/blog/categories/ruby/'>ruby</a>, <a class='category' href='/blog/categories/ubuntu/'>ubuntu</a></span>
  87
+</footer>
  88
+
  89
+
  90
+</article>
  91
+
  92
+</div>
  93
+
  94
+  
  95
+</article>
  96
+
  97
+</div>
  98
+
  99
+<aside class="sidebar">
  100
+  
  101
+    <section>
  102
+  <h1>Recent Posts</h1>
  103
+  <ul id="recent_posts">
  104
+    
  105
+      <li class="post">
  106
+        <a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a>
  107
+      </li>
  108
+    
  109
+  </ul>
  110
+</section>
  111
+
  112
+
  113
+
  114
+
  115
+
  116
+
  117
+  
  118
+</aside>
  119
+
  120
+
  121
+    </div>
  122
+  </div>
  123
+  <footer role="contentinfo"><p>
  124
+  Copyright &copy; 2012 - Wongyouth -
  125
+  <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
  126
+</p>
  127
+
  128
+</footer>
  129
+  
  130
+
  131
+
  132
+
  133
+
  134
+
  135
+
  136
+
  137
+  <script type="text/javascript">
  138
+    (function(){
  139
+      var twitterWidgets = document.createElement('script');
  140
+      twitterWidgets.type = 'text/javascript';
  141
+      twitterWidgets.async = true;
  142
+      twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
  143
+      document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
  144
+    })();
  145
+  </script>
  146
+
  147
+
  148
+
  149
+
  150
+
  151
+</body>
  152
+</html>
101  blog/categories/ubuntu/atom.xml
... ...
@@ -0,0 +1,101 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<feed xmlns="http://www.w3.org/2005/Atom">
  3
+
  4
+  <title><![CDATA[Category: ubuntu | Wongyouth's Blog]]></title>
  5
+  <link href="http://wongyouth.github.com/blog/categories/ubuntu/atom.xml" rel="self"/>
  6
+  <link href="http://wongyouth.github.com/"/>
  7
+  <updated>2012-04-21T18:01:40+08:00</updated>
  8
+  <id>http://wongyouth.github.com/</id>
  9
+  <author>
  10
+    <name><![CDATA[Wongyouth]]></name>
  11
+    
  12
+  </author>
  13
+  <generator uri="http://octopress.org/">Octopress</generator>
  14
+
  15
+  
  16
+  <entry>
  17
+    <title type="html"><![CDATA[Ubuntu下安装ruby开发环境]]></title>
  18
+    <link href="http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu/"/>
  19
+    <updated>2012-04-21T14:41:00+08:00</updated>
  20
+    <id>http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu</id>
  21
+    <content type="html"><![CDATA[<p>开始的时候我也是用Windows作为Rails项目开发的。
  22
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
  23
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。</p>
  24
+
  25
+<p>使用Ubuntu有个好处,每天跟Ubuntu打交道会提高整体的服务器排错水平,因为每天用的就是服务器一样的环境,遇到问题每天都要去解决,久而久之水平也就上去了。</p>
  26
+
  27
+<p>闲话休提。让我们看看如何设置ruby环境吧。</p>
  28
+
  29
+<ol>
  30
+<li>预安装库文件</li>
  31
+<li>安装<code>rbenv</code></li>
  32
+<li>下载并编译<code>ruby</code></li>
  33
+<li>创建第一个<code>Rails</code>项目</li>
  34
+</ol>
  35
+
  36
+
  37
+<h2>安装<code>rbenv-installer</code></h2>
  38
+
  39
+<h4>预安装一些编译时用到的库文件和工具</h4>
  40
+
  41
+<p><code>sh
  42
+sudo apt-get -y install git-core curl \
  43
+build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev \
  44
+zlib1g zlib1g-dev libssl-dev libyaml-dev \
  45
+libsqlite3-0 libsqlite3-dev sqlite3 \
  46
+libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake \
  47
+libtool bison subversion libxslt1-dev
  48
+</code></p>
  49
+
  50
+<p>如果使用jruby的话,安装一个jdk环境</p>
  51
+
  52
+<pre><code>sudo apt-get install default-jdk
  53
+</code></pre>
  54
+
  55
+<h2>安装<code>rbenv</code></h2>
  56
+
  57
+<p>我使用<a href="https://github.com/sstephenson/rbenv">rbenv</a>而不是rvm来作为ruby的版本管理软件。理由在rbenv的项目页面说明的很清楚了,更安全也更简单</p>
  58
+
  59
+<p><code>sh
  60
+curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
  61
+</code></p>
  62
+
  63
+<h2>下载并编译<code>ruby</code></h2>
  64
+
  65
+<p>假设你使用ruby-1.9.3</p>
  66
+
  67
+<p><code>sh
  68
+rbenv install 1.9.3-p125
  69
+rbenv global 1.9.3-p125
  70
+</code></p>
  71
+
  72
+<p>查看可以安装的ruby版本列表</p>
  73
+
  74
+<p><code>sh
  75
+  rbenv versions
  76
+</code></p>
  77
+
  78
+<p>查看当前的ruby版本</p>
  79
+
  80
+<p><code>sh
  81
+  rbenv version
  82
+</code></p>
  83
+
  84
+<p>更新rbenv里的链接指向gems的可执行文件的映射,安装了新的gem包时记得刷新。</p>
  85
+
  86
+<p><code>sh
  87
+  rbenv rehash
  88
+</code></p>
  89
+
  90
+<h2>创建第一个<code>Rails</code>项目</h2>
  91
+
  92
+<p><code>sh
  93
+  gem update --system
  94
+  gem install bundler rails
  95
+  rbenv rehash
  96
+  rails new blog
  97
+</code></p>
  98
+]]></content>
  99
+  </entry>
  100
+  
  101
+</feed>
152  blog/categories/ubuntu/index.html
... ...
@@ -0,0 +1,152 @@
  1
+
  2
+<!DOCTYPE html>
  3
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
  4
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
  5
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
  6
+<head>
  7
+  <meta charset="utf-8">
  8
+  <title>Category: ubuntu - Wongyouth's Blog</title>
  9
+  <meta name="author" content="Wongyouth">
  10
+
  11
+  
  12
+  <meta name="description" content="Category: ubuntu">
  13
+  
  14
+
  15
+  <!-- http://t.co/dKP3o1e -->
  16
+  <meta name="HandheldFriendly" content="True">
  17
+  <meta name="MobileOptimized" content="320">
  18
+  <meta name="viewport" content="width=device-width, initial-scale=1">
  19
+
  20
+  
  21
+  <link rel="canonical" href="http://wongyouth.github.comblog/categories/ubuntu">
  22
+  <link href="/favicon.png" rel="icon">
  23
+  <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
  24
+  <script src="/javascripts/modernizr-2.0.js"></script>
  25
+  <script src="/javascripts/ender.js"></script>
  26
+  <script src="/javascripts/octopress.js" type="text/javascript"></script>
  27
+  <link href="/atom.xml" rel="alternate" title="Wongyouth's Blog" type="application/atom+xml">
  28
+  <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
  29
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
  30
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
  31
+
  32
+  
  33
+
  34
+</head>
  35
+
  36
+<body   >
  37
+  <header role="banner"><hgroup>
  38
+  <h1><a href="/">Wongyouth's Blog</a></h1>
  39
+  
  40
+    <h2>Do things the stupid way.</h2>
  41
+  
  42
+</hgroup>
  43
+
  44
+</header>
  45
+  <nav role="navigation"><ul class="subscription" data-subscription="rss">
  46
+  <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
  47
+  
  48
+</ul>
  49
+  
  50
+<form action="http://google.com/search" method="get">
  51
+  <fieldset role="search">
  52
+    <input type="hidden" name="q" value="site:wongyouth.github.com" />
  53
+    <input class="search" type="text" name="q" results="0" placeholder="Search"/>
  54
+  </fieldset>
  55
+</form>
  56
+  
  57
+<ul class="main-navigation">
  58
+  <li><a href="/">Blog</a></li>
  59
+  <li><a href="/blog/archives">Archives</a></li>
  60
+</ul>
  61
+
  62
+</nav>
  63
+  <div id="main">
  64
+    <div id="content">
  65
+      <div>
  66
+<article role="article">
  67
+  
  68
+  <header>
  69
+    <h1 class="entry-title">Category: Ubuntu</h1>
  70
+    
  71
+  </header>
  72
+  
  73
+  <div id="blog-archives" class="category">
  74
+
  75
+
  76
+
  77
+  
  78
+  <h2>2012</h2>
  79
+
  80
+<article>
  81
+  
  82
+<h1><a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a></h1>
  83
+<time datetime="2012-04-21T14:41:00+08:00" pubdate><span class='month'>Apr</span> <span class='day'>21</span> <span class='year'>2012</span></time>
  84
+
  85
+<footer>
  86
+  <span class="categories">posted in <a class='category' href='/blog/categories/ruby/'>ruby</a>, <a class='category' href='/blog/categories/ubuntu/'>ubuntu</a></span>
  87
+</footer>
  88
+
  89
+
  90
+</article>
  91
+
  92
+</div>
  93
+
  94
+  
  95
+</article>
  96
+
  97
+</div>
  98
+
  99
+<aside class="sidebar">
  100
+  
  101
+    <section>
  102
+  <h1>Recent Posts</h1>
  103
+  <ul id="recent_posts">
  104
+    
  105
+      <li class="post">
  106
+        <a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a>
  107
+      </li>
  108
+    
  109
+  </ul>
  110
+</section>
  111
+
  112
+
  113
+
  114
+
  115
+
  116
+
  117
+  
  118
+</aside>
  119
+
  120
+
  121
+    </div>
  122
+  </div>
  123
+  <footer role="contentinfo"><p>
  124
+  Copyright &copy; 2012 - Wongyouth -
  125
+  <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
  126
+</p>
  127
+
  128
+</footer>
  129
+  
  130
+
  131
+
  132
+
  133
+
  134
+
  135
+
  136
+
  137
+  <script type="text/javascript">
  138
+    (function(){
  139
+      var twitterWidgets = document.createElement('script');
  140
+      twitterWidgets.type = 'text/javascript';
  141
+      twitterWidgets.async = true;
  142
+      twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
  143
+      document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
  144
+    })();
  145
+  </script>
  146
+
  147
+
  148
+
  149
+
  150
+
  151
+</body>
  152
+</html>
136  index.html
@@ -9,7 +9,9 @@
9 9
   <meta name="author" content="Wongyouth">
10 10
 
11 11
   
12  
-  <meta name="description" content=" Blog Archives Recent Posts ">
  12
+  <meta name="description" content="开始的时候我也是用Windows作为Rails项目开发的。
  13
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
  14
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。 使用Ubuntu有个好处, &hellip;">
13 15
   
14 16
 
15 17
   <!-- http://t.co/dKP3o1e -->
@@ -65,6 +67,134 @@
65 67
       <div class="blog-index">
66 68
   
67 69
   
  70
+  
  71
+    <article>
  72
+      
  73
+  <header>
  74
+    
  75
+      <h1 class="entry-title"><a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a></h1>
  76
+    
  77
+    
  78
+      <p class="meta">
  79
+        
  80
+
  81
+
  82
+
  83
+
  84
+
  85
+
  86
+
  87
+
  88
+  
  89
+
  90
+
  91
+<time datetime="2012-04-21T14:41:00+08:00" pubdate data-updated="true">2012-04-21</time>
  92
+        
  93
+      </p>
  94
+    
  95
+  </header>
  96
+
  97
+
  98
+  <div class="entry-content"><p>开始的时候我也是用Windows作为Rails项目开发的。
  99
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
  100
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。</p>
  101
+
  102
+<p>使用Ubuntu有个好处,每天跟Ubuntu打交道会提高整体的服务器排错水平,因为每天用的就是服务器一样的环境,遇到问题每天都要去解决,久而久之水平也就上去了。</p>
  103
+
  104
+<p>闲话休提。让我们看看如何设置ruby环境吧。</p>
  105
+
  106
+<ol>
  107
+<li>预安装库文件</li>
  108
+<li>安装<code>rbenv</code></li>
  109
+<li>下载并编译<code>ruby</code></li>
  110
+<li>创建第一个<code>Rails</code>项目</li>
  111
+</ol>
  112
+
  113
+
  114
+<h2>安装<code>rbenv-installer</code></h2>
  115
+
  116
+<h4>预安装一些编译时用到的库文件和工具</h4>
  117
+
  118
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  119
+<span class='line-number'>2</span>
  120
+<span class='line-number'>3</span>
  121
+<span class='line-number'>4</span>
  122
+<span class='line-number'>5</span>
  123
+<span class='line-number'>6</span>
  124
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>sudo apt-get -y install git-core curl <span class="se">\</span>
  125
+</span><span class='line'>build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev <span class="se">\</span>
  126
+</span><span class='line'>zlib1g zlib1g-dev libssl-dev libyaml-dev <span class="se">\</span>
  127
+</span><span class='line'>libsqlite3-0 libsqlite3-dev sqlite3 <span class="se">\</span>
  128
+</span><span class='line'>libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake <span class="se">\</span>
  129
+</span><span class='line'>libtool bison subversion libxslt1-dev
  130
+</span></code></pre></td></tr></table></div></figure>
  131
+
  132
+
  133
+<p>如果使用jruby的话,安装一个jdk环境</p>
  134
+
  135
+<pre><code>sudo apt-get install default-jdk
  136
+</code></pre>
  137
+
  138
+<h2>安装<code>rbenv</code></h2>
  139
+
  140
+<p>我使用<a href="https://github.com/sstephenson/rbenv">rbenv</a>而不是rvm来作为ruby的版本管理软件。理由在rbenv的项目页面说明的很清楚了,更安全也更简单</p>
  141
+
  142
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  143
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
  144
+</span></code></pre></td></tr></table></div></figure>
  145
+
  146
+
  147
+<h2>下载并编译<code>ruby</code></h2>
  148
+
  149
+<p>假设你使用ruby-1.9.3</p>
  150
+
  151
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  152
+<span class='line-number'>2</span>
  153
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>rbenv install 1.9.3-p125
  154
+</span><span class='line'>rbenv global 1.9.3-p125
  155
+</span></code></pre></td></tr></table></div></figure>
  156
+
  157
+
  158
+<p>查看可以安装的ruby版本列表</p>
  159
+
  160
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  161
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>  rbenv versions
  162
+</span></code></pre></td></tr></table></div></figure>
  163
+
  164
+
  165
+<p>查看当前的ruby版本</p>
  166
+
  167
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  168
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>  rbenv version
  169
+</span></code></pre></td></tr></table></div></figure>
  170
+
  171
+
  172
+<p>更新rbenv里的链接指向gems的可执行文件的映射,安装了新的gem包时记得刷新。</p>
  173
+
  174
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  175
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>  rbenv rehash
  176
+</span></code></pre></td></tr></table></div></figure>
  177
+
  178
+
  179
+<h2>创建第一个<code>Rails</code>项目</h2>
  180
+
  181
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
  182
+<span class='line-number'>2</span>
  183
+<span class='line-number'>3</span>
  184
+<span class='line-number'>4</span>
  185
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>  gem update --system
  186
+</span><span class='line'>  gem install bundler rails
  187
+</span><span class='line'>  rbenv rehash
  188
+</span><span class='line'>  rails new blog
  189
+</span></code></pre></td></tr></table></div></figure>