Permalink
Browse files

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

  • Loading branch information...
1 parent ee56e45 commit 3d050a46d286fa046eb761914aceddf0835dd9fa @wongyouth committed Apr 21, 2012
View
103 atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Wongyouth's Blog]]></title>
<link href="http://wongyouth.github.com/atom.xml" rel="self"/>
<link href="http://wongyouth.github.com/"/>
- <updated>2012-04-21T17:57:55+08:00</updated>
+ <updated>2012-04-21T18:01:40+08:00</updated>
<id>http://wongyouth.github.com/</id>
<author>
<name><![CDATA[Wongyouth]]></name>
@@ -13,4 +13,105 @@
<generator uri="http://octopress.org/">Octopress</generator>
+ <entry>
+ <title type="html"><![CDATA[Ubuntu下安装ruby开发环境]]></title>
+ <link href="http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu/"/>
+ <updated>2012-04-21T14:41:00+08:00</updated>
+ <id>http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu</id>
+ <content type="html"><![CDATA[<p>开始的时候我也是用Windows作为Rails项目开发的。
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。</p>
+
+<p>使用Ubuntu有个好处,每天跟Ubuntu打交道会提高整体的服务器排错水平,因为每天用的就是服务器一样的环境,遇到问题每天都要去解决,久而久之水平也就上去了。</p>
+
+<p>闲话休提。让我们看看如何设置ruby环境吧。</p>
+
+<ol>
+<li>预安装库文件</li>
+<li>安装<code>rbenv</code></li>
+<li>下载并编译<code>ruby</code></li>
+<li>创建第一个<code>Rails</code>项目</li>
+</ol>
+
+
+<h2>安装<code>rbenv-installer</code></h2>
+
+<h4>预安装一些编译时用到的库文件和工具</h4>
+
+<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>
+<span class='line-number'>2</span>
+<span class='line-number'>3</span>
+<span class='line-number'>4</span>
+<span class='line-number'>5</span>
+<span class='line-number'>6</span>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>sudo apt-get -y install git-core curl <span class="se">\</span>
+</span><span class='line'>build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev <span class="se">\</span>
+</span><span class='line'>zlib1g zlib1g-dev libssl-dev libyaml-dev <span class="se">\</span>
+</span><span class='line'>libsqlite3-0 libsqlite3-dev sqlite3 <span class="se">\</span>
+</span><span class='line'>libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake <span class="se">\</span>
+</span><span class='line'>libtool bison subversion libxslt1-dev
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>如果使用jruby的话,安装一个jdk环境</p>
+
+<pre><code>sudo apt-get install default-jdk
+</code></pre>
+
+<h2>安装<code>rbenv</code></h2>
+
+<p>我使用<a href="https://github.com/sstephenson/rbenv">rbenv</a>而不是rvm来作为ruby的版本管理软件。理由在rbenv的项目页面说明的很清楚了,更安全也更简单</p>
+
+<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>
+</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
+</span></code></pre></td></tr></table></div></figure>
+
+
+<h2>下载并编译<code>ruby</code></h2>
+
+<p>假设你使用ruby-1.9.3</p>
+
+<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>
+<span class='line-number'>2</span>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>rbenv install 1.9.3-p125
+</span><span class='line'>rbenv global 1.9.3-p125
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>查看可以安装的ruby版本列表</p>
+
+<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>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'> rbenv versions
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>查看当前的ruby版本</p>
+
+<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>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'> rbenv version
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>更新rbenv里的链接指向gems的可执行文件的映射,安装了新的gem包时记得刷新。</p>
+
+<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>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'> rbenv rehash
+</span></code></pre></td></tr></table></div></figure>
+
+
+<h2>创建第一个<code>Rails</code>项目</h2>
+
+<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>
+<span class='line-number'>2</span>
+<span class='line-number'>3</span>
+<span class='line-number'>4</span>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'> gem update --system
+</span><span class='line'> gem install bundler rails
+</span><span class='line'> rbenv rehash
+</span><span class='line'> rails new blog
+</span></code></pre></td></tr></table></div></figure>
+
+]]></content>
+ </entry>
+
</feed>
View
293 blog/2012/04/21/install-ruby-environment-on-ubuntu/index.html
@@ -0,0 +1,293 @@
+
+<!DOCTYPE html>
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <title>Ubuntu下安装ruby开发环境 - Wongyouth's Blog</title>
+ <meta name="author" content="Wongyouth">
+
+
+ <meta name="description" content="开始的时候我也是用Windows作为Rails项目开发的。
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。 使用Ubuntu有个好处, &hellip;">
+
+
+ <!-- http://t.co/dKP3o1e -->
+ <meta name="HandheldFriendly" content="True">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+
+ <link rel="canonical" href="http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu">
+ <link href="/favicon.png" rel="icon">
+ <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
+ <script src="/javascripts/modernizr-2.0.js"></script>
+ <script src="/javascripts/ender.js"></script>
+ <script src="/javascripts/octopress.js" type="text/javascript"></script>
+ <link href="/atom.xml" rel="alternate" title="Wongyouth's Blog" type="application/atom+xml">
+ <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+
+
+
+</head>
+
+<body >
+ <header role="banner"><hgroup>
+ <h1><a href="/">Wongyouth's Blog</a></h1>
+
+ <h2>Do things the stupid way.</h2>
+
+</hgroup>
+
+</header>
+ <nav role="navigation"><ul class="subscription" data-subscription="rss">
+ <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
+
+</ul>
+
+<form action="http://google.com/search" method="get">
+ <fieldset role="search">
+ <input type="hidden" name="q" value="site:wongyouth.github.com" />
+ <input class="search" type="text" name="q" results="0" placeholder="Search"/>
+ </fieldset>
+</form>
+
+<ul class="main-navigation">
+ <li><a href="/">Blog</a></li>
+ <li><a href="/blog/archives">Archives</a></li>
+</ul>
+
+</nav>
+ <div id="main">
+ <div id="content">
+ <div>
+<article class="hentry" role="article">
+
+ <header>
+
+ <h1 class="entry-title">Ubuntu下安装ruby开发环境</h1>
+
+
+ <p class="meta">
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2012-04-21T14:41:00+08:00" pubdate data-updated="true">2012-04-21</time>
+
+ </p>
+
+ </header>
+
+
+<div class="entry-content"><p>开始的时候我也是用Windows作为Rails项目开发的。
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。</p>
+
+<p>使用Ubuntu有个好处,每天跟Ubuntu打交道会提高整体的服务器排错水平,因为每天用的就是服务器一样的环境,遇到问题每天都要去解决,久而久之水平也就上去了。</p>
+
+<p>闲话休提。让我们看看如何设置ruby环境吧。</p>
+
+<ol>
+<li>预安装库文件</li>
+<li>安装<code>rbenv</code></li>
+<li>下载并编译<code>ruby</code></li>
+<li>创建第一个<code>Rails</code>项目</li>
+</ol>
+
+
+<h2>安装<code>rbenv-installer</code></h2>
+
+<h4>预安装一些编译时用到的库文件和工具</h4>
+
+<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>
+<span class='line-number'>2</span>
+<span class='line-number'>3</span>
+<span class='line-number'>4</span>
+<span class='line-number'>5</span>
+<span class='line-number'>6</span>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>sudo apt-get -y install git-core curl <span class="se">\</span>
+</span><span class='line'>build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev <span class="se">\</span>
+</span><span class='line'>zlib1g zlib1g-dev libssl-dev libyaml-dev <span class="se">\</span>
+</span><span class='line'>libsqlite3-0 libsqlite3-dev sqlite3 <span class="se">\</span>
+</span><span class='line'>libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake <span class="se">\</span>
+</span><span class='line'>libtool bison subversion libxslt1-dev
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>如果使用jruby的话,安装一个jdk环境</p>
+
+<pre><code>sudo apt-get install default-jdk
+</code></pre>
+
+<h2>安装<code>rbenv</code></h2>
+
+<p>我使用<a href="https://github.com/sstephenson/rbenv">rbenv</a>而不是rvm来作为ruby的版本管理软件。理由在rbenv的项目页面说明的很清楚了,更安全也更简单</p>
+
+<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>
+</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
+</span></code></pre></td></tr></table></div></figure>
+
+
+<h2>下载并编译<code>ruby</code></h2>
+
+<p>假设你使用ruby-1.9.3</p>
+
+<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>
+<span class='line-number'>2</span>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>rbenv install 1.9.3-p125
+</span><span class='line'>rbenv global 1.9.3-p125
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>查看可以安装的ruby版本列表</p>
+
+<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>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'> rbenv versions
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>查看当前的ruby版本</p>
+
+<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>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'> rbenv version
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>更新rbenv里的链接指向gems的可执行文件的映射,安装了新的gem包时记得刷新。</p>
+
+<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>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'> rbenv rehash
+</span></code></pre></td></tr></table></div></figure>
+
+
+<h2>创建第一个<code>Rails</code>项目</h2>
+
+<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>
+<span class='line-number'>2</span>
+<span class='line-number'>3</span>
+<span class='line-number'>4</span>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'> gem update --system
+</span><span class='line'> gem install bundler rails
+</span><span class='line'> rbenv rehash
+</span><span class='line'> rails new blog
+</span></code></pre></td></tr></table></div></figure>
+
+</div>
+
+
+ <footer>
+ <p class="meta">
+
+
+
+<span class="byline author vcard">Posted by <span class="fn">Wongyouth</span></span>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2012-04-21T14:41:00+08:00" pubdate data-updated="true">2012-04-21</time>
+
+
+<span class="categories">
+
+ <a class='category' href='/blog/categories/ruby/'>ruby</a>, <a class='category' href='/blog/categories/ubuntu/'>ubuntu</a>
+
+</span>
+
+
+ </p>
+
+ <div class="sharing">
+
+ <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>
+
+
+
+</div>
+
+
+ <p class="meta">
+
+
+ </p>
+ </footer>
+</article>
+
+</div>
+
+<aside class="sidebar">
+
+ <section>
+ <h1>Recent Posts</h1>
+ <ul id="recent_posts">
+
+ <li class="post">
+ <a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a>
+ </li>
+
+ </ul>
+</section>
+
+
+
+
+
+
+
+</aside>
+
+
+ </div>
+ </div>
+ <footer role="contentinfo"><p>
+ Copyright &copy; 2012 - Wongyouth -
+ <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
+</p>
+
+</footer>
+
+
+
+
+
+
+
+
+ <script type="text/javascript">
+ (function(){
+ var twitterWidgets = document.createElement('script');
+ twitterWidgets.type = 'text/javascript';
+ twitterWidgets.async = true;
+ twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
+ document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
+ })();
+ </script>
+
+
+
+
+
+</body>
+</html>
View
24 blog/archives/index.html
@@ -9,7 +9,8 @@
<meta name="author" content="Wongyouth">
- <meta name="description" content=" Blog Archive Recent Posts ">
+ <meta name="description" content=" Blog Archive 2012 Ubuntu下安装ruby开发环境
+Apr 21 2012 posted in ruby, ubuntu Recent Posts Ubuntu下安装ruby开发环境 ">
<!-- http://t.co/dKP3o1e -->
@@ -72,6 +73,23 @@ <h1 class="entry-title">Blog Archive</h1>
<div id="blog-archives">
+
+
+
+ <h2>2012</h2>
+
+<article>
+
+<h1><a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a></h1>
+<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>
+
+<footer>
+ <span class="categories">posted in <a class='category' href='/blog/categories/ruby/'>ruby</a>, <a class='category' href='/blog/categories/ubuntu/'>ubuntu</a></span>
+</footer>
+
+
+</article>
+
</div>
@@ -85,6 +103,10 @@ <h1 class="entry-title">Blog Archive</h1>
<h1>Recent Posts</h1>
<ul id="recent_posts">
+ <li class="post">
+ <a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a>
+ </li>
+
</ul>
</section>
View
101 blog/categories/ruby/atom.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+
+ <title><![CDATA[Category: ruby | Wongyouth's Blog]]></title>
+ <link href="http://wongyouth.github.com/blog/categories/ruby/atom.xml" rel="self"/>
+ <link href="http://wongyouth.github.com/"/>
+ <updated>2012-04-21T18:01:40+08:00</updated>
+ <id>http://wongyouth.github.com/</id>
+ <author>
+ <name><![CDATA[Wongyouth]]></name>
+
+ </author>
+ <generator uri="http://octopress.org/">Octopress</generator>
+
+
+ <entry>
+ <title type="html"><![CDATA[Ubuntu下安装ruby开发环境]]></title>
+ <link href="http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu/"/>
+ <updated>2012-04-21T14:41:00+08:00</updated>
+ <id>http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu</id>
+ <content type="html"><![CDATA[<p>开始的时候我也是用Windows作为Rails项目开发的。
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。</p>
+
+<p>使用Ubuntu有个好处,每天跟Ubuntu打交道会提高整体的服务器排错水平,因为每天用的就是服务器一样的环境,遇到问题每天都要去解决,久而久之水平也就上去了。</p>
+
+<p>闲话休提。让我们看看如何设置ruby环境吧。</p>
+
+<ol>
+<li>预安装库文件</li>
+<li>安装<code>rbenv</code></li>
+<li>下载并编译<code>ruby</code></li>
+<li>创建第一个<code>Rails</code>项目</li>
+</ol>
+
+
+<h2>安装<code>rbenv-installer</code></h2>
+
+<h4>预安装一些编译时用到的库文件和工具</h4>
+
+<p><code>sh
+sudo apt-get -y install git-core curl \
+build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev \
+zlib1g zlib1g-dev libssl-dev libyaml-dev \
+libsqlite3-0 libsqlite3-dev sqlite3 \
+libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake \
+libtool bison subversion libxslt1-dev
+</code></p>
+
+<p>如果使用jruby的话,安装一个jdk环境</p>
+
+<pre><code>sudo apt-get install default-jdk
+</code></pre>
+
+<h2>安装<code>rbenv</code></h2>
+
+<p>我使用<a href="https://github.com/sstephenson/rbenv">rbenv</a>而不是rvm来作为ruby的版本管理软件。理由在rbenv的项目页面说明的很清楚了,更安全也更简单</p>
+
+<p><code>sh
+curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
+</code></p>
+
+<h2>下载并编译<code>ruby</code></h2>
+
+<p>假设你使用ruby-1.9.3</p>
+
+<p><code>sh
+rbenv install 1.9.3-p125
+rbenv global 1.9.3-p125
+</code></p>
+
+<p>查看可以安装的ruby版本列表</p>
+
+<p><code>sh
+ rbenv versions
+</code></p>
+
+<p>查看当前的ruby版本</p>
+
+<p><code>sh
+ rbenv version
+</code></p>
+
+<p>更新rbenv里的链接指向gems的可执行文件的映射,安装了新的gem包时记得刷新。</p>
+
+<p><code>sh
+ rbenv rehash
+</code></p>
+
+<h2>创建第一个<code>Rails</code>项目</h2>
+
+<p><code>sh
+ gem update --system
+ gem install bundler rails
+ rbenv rehash
+ rails new blog
+</code></p>
+]]></content>
+ </entry>
+
+</feed>
View
152 blog/categories/ruby/index.html
@@ -0,0 +1,152 @@
+
+<!DOCTYPE html>
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <title>Category: ruby - Wongyouth's Blog</title>
+ <meta name="author" content="Wongyouth">
+
+
+ <meta name="description" content="Category: ruby">
+
+
+ <!-- http://t.co/dKP3o1e -->
+ <meta name="HandheldFriendly" content="True">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+
+ <link rel="canonical" href="http://wongyouth.github.comblog/categories/ruby">
+ <link href="/favicon.png" rel="icon">
+ <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
+ <script src="/javascripts/modernizr-2.0.js"></script>
+ <script src="/javascripts/ender.js"></script>
+ <script src="/javascripts/octopress.js" type="text/javascript"></script>
+ <link href="/atom.xml" rel="alternate" title="Wongyouth's Blog" type="application/atom+xml">
+ <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+
+
+
+</head>
+
+<body >
+ <header role="banner"><hgroup>
+ <h1><a href="/">Wongyouth's Blog</a></h1>
+
+ <h2>Do things the stupid way.</h2>
+
+</hgroup>
+
+</header>
+ <nav role="navigation"><ul class="subscription" data-subscription="rss">
+ <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
+
+</ul>
+
+<form action="http://google.com/search" method="get">
+ <fieldset role="search">
+ <input type="hidden" name="q" value="site:wongyouth.github.com" />
+ <input class="search" type="text" name="q" results="0" placeholder="Search"/>
+ </fieldset>
+</form>
+
+<ul class="main-navigation">
+ <li><a href="/">Blog</a></li>
+ <li><a href="/blog/archives">Archives</a></li>
+</ul>
+
+</nav>
+ <div id="main">
+ <div id="content">
+ <div>
+<article role="article">
+
+ <header>
+ <h1 class="entry-title">Category: Ruby</h1>
+
+ </header>
+
+ <div id="blog-archives" class="category">
+
+
+
+
+ <h2>2012</h2>
+
+<article>
+
+<h1><a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a></h1>
+<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>
+
+<footer>
+ <span class="categories">posted in <a class='category' href='/blog/categories/ruby/'>ruby</a>, <a class='category' href='/blog/categories/ubuntu/'>ubuntu</a></span>
+</footer>
+
+
+</article>
+
+</div>
+
+
+</article>
+
+</div>
+
+<aside class="sidebar">
+
+ <section>
+ <h1>Recent Posts</h1>
+ <ul id="recent_posts">
+
+ <li class="post">
+ <a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a>
+ </li>
+
+ </ul>
+</section>
+
+
+
+
+
+
+
+</aside>
+
+
+ </div>
+ </div>
+ <footer role="contentinfo"><p>
+ Copyright &copy; 2012 - Wongyouth -
+ <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
+</p>
+
+</footer>
+
+
+
+
+
+
+
+
+ <script type="text/javascript">
+ (function(){
+ var twitterWidgets = document.createElement('script');
+ twitterWidgets.type = 'text/javascript';
+ twitterWidgets.async = true;
+ twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
+ document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
+ })();
+ </script>
+
+
+
+
+
+</body>
+</html>
View
101 blog/categories/ubuntu/atom.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+
+ <title><![CDATA[Category: ubuntu | Wongyouth's Blog]]></title>
+ <link href="http://wongyouth.github.com/blog/categories/ubuntu/atom.xml" rel="self"/>
+ <link href="http://wongyouth.github.com/"/>
+ <updated>2012-04-21T18:01:40+08:00</updated>
+ <id>http://wongyouth.github.com/</id>
+ <author>
+ <name><![CDATA[Wongyouth]]></name>
+
+ </author>
+ <generator uri="http://octopress.org/">Octopress</generator>
+
+
+ <entry>
+ <title type="html"><![CDATA[Ubuntu下安装ruby开发环境]]></title>
+ <link href="http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu/"/>
+ <updated>2012-04-21T14:41:00+08:00</updated>
+ <id>http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu</id>
+ <content type="html"><![CDATA[<p>开始的时候我也是用Windows作为Rails项目开发的。
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。</p>
+
+<p>使用Ubuntu有个好处,每天跟Ubuntu打交道会提高整体的服务器排错水平,因为每天用的就是服务器一样的环境,遇到问题每天都要去解决,久而久之水平也就上去了。</p>
+
+<p>闲话休提。让我们看看如何设置ruby环境吧。</p>
+
+<ol>
+<li>预安装库文件</li>
+<li>安装<code>rbenv</code></li>
+<li>下载并编译<code>ruby</code></li>
+<li>创建第一个<code>Rails</code>项目</li>
+</ol>
+
+
+<h2>安装<code>rbenv-installer</code></h2>
+
+<h4>预安装一些编译时用到的库文件和工具</h4>
+
+<p><code>sh
+sudo apt-get -y install git-core curl \
+build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev \
+zlib1g zlib1g-dev libssl-dev libyaml-dev \
+libsqlite3-0 libsqlite3-dev sqlite3 \
+libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake \
+libtool bison subversion libxslt1-dev
+</code></p>
+
+<p>如果使用jruby的话,安装一个jdk环境</p>
+
+<pre><code>sudo apt-get install default-jdk
+</code></pre>
+
+<h2>安装<code>rbenv</code></h2>
+
+<p>我使用<a href="https://github.com/sstephenson/rbenv">rbenv</a>而不是rvm来作为ruby的版本管理软件。理由在rbenv的项目页面说明的很清楚了,更安全也更简单</p>
+
+<p><code>sh
+curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
+</code></p>
+
+<h2>下载并编译<code>ruby</code></h2>
+
+<p>假设你使用ruby-1.9.3</p>
+
+<p><code>sh
+rbenv install 1.9.3-p125
+rbenv global 1.9.3-p125
+</code></p>
+
+<p>查看可以安装的ruby版本列表</p>
+
+<p><code>sh
+ rbenv versions
+</code></p>
+
+<p>查看当前的ruby版本</p>
+
+<p><code>sh
+ rbenv version
+</code></p>
+
+<p>更新rbenv里的链接指向gems的可执行文件的映射,安装了新的gem包时记得刷新。</p>
+
+<p><code>sh
+ rbenv rehash
+</code></p>
+
+<h2>创建第一个<code>Rails</code>项目</h2>
+
+<p><code>sh
+ gem update --system
+ gem install bundler rails
+ rbenv rehash
+ rails new blog
+</code></p>
+]]></content>
+ </entry>
+
+</feed>
View
152 blog/categories/ubuntu/index.html
@@ -0,0 +1,152 @@
+
+<!DOCTYPE html>
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <title>Category: ubuntu - Wongyouth's Blog</title>
+ <meta name="author" content="Wongyouth">
+
+
+ <meta name="description" content="Category: ubuntu">
+
+
+ <!-- http://t.co/dKP3o1e -->
+ <meta name="HandheldFriendly" content="True">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+
+ <link rel="canonical" href="http://wongyouth.github.comblog/categories/ubuntu">
+ <link href="/favicon.png" rel="icon">
+ <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
+ <script src="/javascripts/modernizr-2.0.js"></script>
+ <script src="/javascripts/ender.js"></script>
+ <script src="/javascripts/octopress.js" type="text/javascript"></script>
+ <link href="/atom.xml" rel="alternate" title="Wongyouth's Blog" type="application/atom+xml">
+ <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+
+
+
+</head>
+
+<body >
+ <header role="banner"><hgroup>
+ <h1><a href="/">Wongyouth's Blog</a></h1>
+
+ <h2>Do things the stupid way.</h2>
+
+</hgroup>
+
+</header>
+ <nav role="navigation"><ul class="subscription" data-subscription="rss">
+ <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
+
+</ul>
+
+<form action="http://google.com/search" method="get">
+ <fieldset role="search">
+ <input type="hidden" name="q" value="site:wongyouth.github.com" />
+ <input class="search" type="text" name="q" results="0" placeholder="Search"/>
+ </fieldset>
+</form>
+
+<ul class="main-navigation">
+ <li><a href="/">Blog</a></li>
+ <li><a href="/blog/archives">Archives</a></li>
+</ul>
+
+</nav>
+ <div id="main">
+ <div id="content">
+ <div>
+<article role="article">
+
+ <header>
+ <h1 class="entry-title">Category: Ubuntu</h1>
+
+ </header>
+
+ <div id="blog-archives" class="category">
+
+
+
+
+ <h2>2012</h2>
+
+<article>
+
+<h1><a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a></h1>
+<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>
+
+<footer>
+ <span class="categories">posted in <a class='category' href='/blog/categories/ruby/'>ruby</a>, <a class='category' href='/blog/categories/ubuntu/'>ubuntu</a></span>
+</footer>
+
+
+</article>
+
+</div>
+
+
+</article>
+
+</div>
+
+<aside class="sidebar">
+
+ <section>
+ <h1>Recent Posts</h1>
+ <ul id="recent_posts">
+
+ <li class="post">
+ <a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a>
+ </li>
+
+ </ul>
+</section>
+
+
+
+
+
+
+
+</aside>
+
+
+ </div>
+ </div>
+ <footer role="contentinfo"><p>
+ Copyright &copy; 2012 - Wongyouth -
+ <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
+</p>
+
+</footer>
+
+
+
+
+
+
+
+
+ <script type="text/javascript">
+ (function(){
+ var twitterWidgets = document.createElement('script');
+ twitterWidgets.type = 'text/javascript';
+ twitterWidgets.async = true;
+ twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
+ document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
+ })();
+ </script>
+
+
+
+
+
+</body>
+</html>
View
136 index.html
@@ -9,7 +9,9 @@
<meta name="author" content="Wongyouth">
- <meta name="description" content=" Blog Archives Recent Posts ">
+ <meta name="description" content="开始的时候我也是用Windows作为Rails项目开发的。
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。 使用Ubuntu有个好处, &hellip;">
<!-- http://t.co/dKP3o1e -->
@@ -65,6 +67,134 @@
<div class="blog-index">
+
+ <article>
+
+ <header>
+
+ <h1 class="entry-title"><a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a></h1>
+
+
+ <p class="meta">
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2012-04-21T14:41:00+08:00" pubdate data-updated="true">2012-04-21</time>
+
+ </p>
+
+ </header>
+
+
+ <div class="entry-content"><p>开始的时候我也是用Windows作为Rails项目开发的。
+但是在Windows下会碰到各种各样的问题,最常见的就是Gem包可能只工作在类Unix的环境下。
+有的时候按照官方说明一步一步做仍然有各种各样的不成功。痛定思痛用Ubuntu做为开发环境。</p>
+
+<p>使用Ubuntu有个好处,每天跟Ubuntu打交道会提高整体的服务器排错水平,因为每天用的就是服务器一样的环境,遇到问题每天都要去解决,久而久之水平也就上去了。</p>
+
+<p>闲话休提。让我们看看如何设置ruby环境吧。</p>
+
+<ol>
+<li>预安装库文件</li>
+<li>安装<code>rbenv</code></li>
+<li>下载并编译<code>ruby</code></li>
+<li>创建第一个<code>Rails</code>项目</li>
+</ol>
+
+
+<h2>安装<code>rbenv-installer</code></h2>
+
+<h4>预安装一些编译时用到的库文件和工具</h4>
+
+<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>
+<span class='line-number'>2</span>
+<span class='line-number'>3</span>
+<span class='line-number'>4</span>
+<span class='line-number'>5</span>
+<span class='line-number'>6</span>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>sudo apt-get -y install git-core curl <span class="se">\</span>
+</span><span class='line'>build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev <span class="se">\</span>
+</span><span class='line'>zlib1g zlib1g-dev libssl-dev libyaml-dev <span class="se">\</span>
+</span><span class='line'>libsqlite3-0 libsqlite3-dev sqlite3 <span class="se">\</span>
+</span><span class='line'>libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake <span class="se">\</span>
+</span><span class='line'>libtool bison subversion libxslt1-dev
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>如果使用jruby的话,安装一个jdk环境</p>
+
+<pre><code>sudo apt-get install default-jdk
+</code></pre>
+
+<h2>安装<code>rbenv</code></h2>
+
+<p>我使用<a href="https://github.com/sstephenson/rbenv">rbenv</a>而不是rvm来作为ruby的版本管理软件。理由在rbenv的项目页面说明的很清楚了,更安全也更简单</p>
+
+<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>
+</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
+</span></code></pre></td></tr></table></div></figure>
+
+
+<h2>下载并编译<code>ruby</code></h2>
+
+<p>假设你使用ruby-1.9.3</p>
+
+<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>
+<span class='line-number'>2</span>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'>rbenv install 1.9.3-p125
+</span><span class='line'>rbenv global 1.9.3-p125
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>查看可以安装的ruby版本列表</p>
+
+<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>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'> rbenv versions
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>查看当前的ruby版本</p>
+
+<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>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'> rbenv version
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>更新rbenv里的链接指向gems的可执行文件的映射,安装了新的gem包时记得刷新。</p>
+
+<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>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'> rbenv rehash
+</span></code></pre></td></tr></table></div></figure>
+
+
+<h2>创建第一个<code>Rails</code>项目</h2>
+
+<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>
+<span class='line-number'>2</span>
+<span class='line-number'>3</span>
+<span class='line-number'>4</span>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'> gem update --system
+</span><span class='line'> gem install bundler rails
+</span><span class='line'> rbenv rehash
+</span><span class='line'> rails new blog
+</span></code></pre></td></tr></table></div></figure>
+
+</div>
+
+
+
+
+ </article>
+
<div class="pagination">
<a href="/blog/archives">Blog Archives</a>
@@ -77,6 +207,10 @@
<h1>Recent Posts</h1>
<ul id="recent_posts">
+ <li class="post">
+ <a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a>
+ </li>
+
</ul>
</section>
View
8 sitemap.xml
@@ -1,11 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>
<url>
+ <loc>http://wongyouth.github.com/blog/2012/04/21/install-ruby-environment-on-ubuntu/</loc>
+ <lastmod>2012-04-21T18:01:21+08:00</lastmod>
+ </url>
+ <url>
<loc>http://wongyouth.github.com/blog/archives/</loc>
- <lastmod>2012-04-20T16:36:09+08:00</lastmod>
+ <lastmod>2012-04-21T18:01:21+08:00</lastmod>
</url>
<url>
<loc>http://wongyouth.github.com/</loc>
- <lastmod>2012-04-20T16:36:09+08:00</lastmod>
+ <lastmod>2012-04-21T18:01:21+08:00</lastmod>
</url>
</urlset>

0 comments on commit 3d050a4

Please sign in to comment.