<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>William&#039;s Blog</title>
	<atom:link href="http://www.williamyang.org/feed" rel="self" type="application/rss+xml" />
	<link>http://www.williamyang.org</link>
	<description>All you&#039;ve got to do is decide to go and the hardest part is over. SO GO!</description>
	<lastBuildDate>Thu, 16 Feb 2012 05:55:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>在 Mac 中安装 RoR 开发环境</title>
		<link>http://www.williamyang.org/archives/1?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%259c%25a8-mac-%25e4%25b8%25ad%25e5%25ae%2589%25e8%25a3%2585-ruby</link>
		<comments>http://www.williamyang.org/archives/1#comments</comments>
		<pubDate>Wed, 15 Feb 2012 14:24:22 +0000</pubDate>
		<dc:creator>William</dc:creator>
				<category><![CDATA[软件开发]]></category>
		<category><![CDATA[RoR]]></category>
		<category><![CDATA[技术]]></category>

		<guid isPermaLink="false">http://www.williamyang.org/?p=14</guid>
		<description><![CDATA[07年以后就几乎没有写过代码，转型到市场和销售，这几年的转型还算成功，但编程也丢得差不多。来到厦门以后远离家人，下班属于自己的时间越来越多。下班闲了几个月以后心痒痒想把编程重新捡起来，特别是看了Jason Fried  和 Heinemeier David Hansson 写的 《Rework》、《Getting Real》以后有种冲动，总想写点东西，下班以后的时间浪费太可惜了。 做程序员那会儿，一只写C/S，现在要转B/S，在 Python 和 Ruby 之间犹豫了一段时间以后，终于选择了 RoR，一个人写代码当然想选择生产效率高的工具，Ruby 的代码虽然没有 Python 优雅，但是也算是门使用性很强的语言。既然已经决定，那就上路吧。 首先要在我的 Mac Lion 上搭建 RoR 环境: 1. 机器上早就安装过 XCode，所以第一步先安装 RVM， bash &#60; &#60;( curl -s https://rvm.beginrescueend.com/install/rvm ) 2. 到http://www.ruby-lang.org看到Ruby的最新版本是1.9.3，当然安装最新的版本 rvm install 1.9.3 没想到编译 Ruby 的时候报错了，提示是： Error running &#8216; ./configure &#8211;prefix=/Users/williamyang/.rvm/rubies/ruby-1.9.3-p0 &#8211;enable-shared &#8211;disable-install-doc &#8211;with-libyaml &#8211;with-opt-dir=/Users/williamyang/.rvm/usr &#8216;, please read <a href='http://www.williamyang.org/archives/1' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>07年以后就几乎没有写过代码，转型到市场和销售，这几年的转型还算成功，但编程也丢得差不多。来到厦门以后远离家人，下班属于自己的时间越来越多。下班闲了几个月以后心痒痒想把编程重新捡起来，特别是看了Jason Fried  和 Heinemeier David Hansson 写的 <a title="Rework" href="http://book.douban.com/subject/3889178/" target="_blank">《Rework》</a>、<a title="Getting Real" href="http://book.douban.com/subject/3567853/" target="_blank">《Getting Real》</a>以后有种冲动，总想写点东西，下班以后的时间浪费太可惜了。</p>
<p>做程序员那会儿，一只写C/S，现在要转B/S，在 Python 和 Ruby 之间犹豫了一段时间以后，终于选择了 <a title="Ruby on Rails" href="http://rubyonrails.org/" target="_blank">RoR</a>，一个人写代码当然想选择生产效率高的工具，Ruby 的代码虽然没有 Python 优雅，但是也算是门使用性很强的语言。既然已经决定，那就上路吧。 首先要在我的 Mac Lion 上搭建 RoR 环境:</p>
<p>1. 机器上早就安装过 XCode，所以第一步先安装 RVM，<br />
<span style="color: #0000ff;">bash &lt; &lt;( curl -s https://rvm.beginrescueend.com/install/rvm )</span></p>
<p>2. 到http://www.ruby-lang.org看到Ruby的最新版本是1.9.3，当然安装最新的版本<br />
<span style="color: #0000ff;">rvm install 1.9.3</span><br />
没想到编译 Ruby 的时候报错了，提示是：<br />
Error running &#8216; ./configure &#8211;prefix=/Users/williamyang/.rvm/rubies/ruby-1.9.3-p0 &#8211;enable-shared &#8211;disable-install-doc &#8211;with-libyaml &#8211;with-opt-dir=/Users/williamyang/.rvm/usr &#8216;, please read /Users/williamyang/.rvm/log/ruby-1.9.3-p0/configure.log There has been an error while running configure. Halting the installation.<br />
按提示查看 configure.log出现的错误提示信息是 configure: error: C compiler cannot create executables mac，原来是我的 XCode 升级到 4.2 以后 C 编译器是 llvm-gcc-4.2 所以在 rvm 安装 Ruby 的时候找不到 C 编译器。重新输入：<br />
<span style="color: #0000ff;">rvm install 1.9.3 &#8211;with-gcc=clang<br />
<span style="color: #000000;">问题解决。 </span></span></p>
<p>3. 将系统自带的 Ruby 1.8.7 替换为 1.9.3<br />
<span style="color: #0000ff;">rvm &#8211;default 1.9.3</span></p>
<p>4. 安装 Gems<br />
<span style="color: #0000ff;">gem update &#8211;system</span></p>
<p>5. 安装 Rails<br />
<span style="color: #0000ff;">gem install rails</span></p>
<p>搞掂！新的旅途开始了&#8230;&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.williamyang.org/archives/1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

