<?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>漂自己的移，让别人都撞墙去吧 &#187; Rails</title>
	<atom:link href="http://www.gagahappy.com/tag/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gagahappy.com</link>
	<description>Life is what? Get busy living or get busy dying</description>
	<lastBuildDate>Tue, 07 Feb 2012 10:19:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>ruby escape</title>
		<link>http://www.gagahappy.com/ruby-escape/</link>
		<comments>http://www.gagahappy.com/ruby-escape/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 02:32:47 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3955</guid>
		<description><![CDATA[require 'cgi' url = 'http://www.gagahappy.com/美食大下' url_escape = CGI::escape&#40;url&#41; url_unescape = CGI::unescape&#40;url_escape&#41; puts url_escape puts url_unescape 您可能感兴趣的文章 ruby p3p协议 Python赢得Tiobe 2010年度语言大奖 rails3.0怪异的数据库密码配置 rails项目开发环境一定要与服务器生产环境一致 ruby 安装 rmagick XPath image_tag validates_inclusion_of 使用ri查看Rails的API strftime函数将时间格式化]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'cgi'</span>
url = <span style="color:#996600;">'http://www.gagahappy.com/美食大下'</span>
url_escape = <span style="color:#CC00FF; font-weight:bold;">CGI</span>::escape<span style="color:#006600; font-weight:bold;">&#40;</span>url<span style="color:#006600; font-weight:bold;">&#41;</span>
url_unescape = <span style="color:#CC00FF; font-weight:bold;">CGI</span>::unescape<span style="color:#006600; font-weight:bold;">&#40;</span>url_escape<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> url_escape
<span style="color:#CC0066; font-weight:bold;">puts</span> url_unescape</pre></div></div>

<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/ruby-p3p-def/' rel='bookmark' title='ruby p3p协议'>ruby p3p协议</a></li>
<li><a href='http://www.gagahappy.com/python-tiobe-award/' rel='bookmark' title='Python赢得Tiobe 2010年度语言大奖'>Python赢得Tiobe 2010年度语言大奖</a></li>
<li><a href='http://www.gagahappy.com/rails3-passwd-must-to-be-string-format/' rel='bookmark' title='rails3.0怪异的数据库密码配置'>rails3.0怪异的数据库密码配置</a></li>
<li><a href='http://www.gagahappy.com/rails-dev-production/' rel='bookmark' title='rails项目开发环境一定要与服务器生产环境一致'>rails项目开发环境一定要与服务器生产环境一致</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/xpath/' rel='bookmark' title='XPath'>XPath</a></li>
<li><a href='http://www.gagahappy.com/image_tag/' rel='bookmark' title='image_tag'>image_tag</a></li>
<li><a href='http://www.gagahappy.com/validates_inclusion_of/' rel='bookmark' title='validates_inclusion_of'>validates_inclusion_of</a></li>
<li><a href='http://www.gagahappy.com/ri-rails-api/' rel='bookmark' title='使用ri查看Rails的API'>使用ri查看Rails的API</a></li>
<li><a href='http://www.gagahappy.com/strftime/' rel='bookmark' title='strftime函数将时间格式化'>strftime函数将时间格式化</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/ruby-escape/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何查看 ActiveRecord::Base.connection.executes 的执行结果？</title>
		<link>http://www.gagahappy.com/activerecordbase-connection-executes/</link>
		<comments>http://www.gagahappy.com/activerecordbase-connection-executes/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 07:59:55 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3959</guid>
		<description><![CDATA[拿mysql2这个gem来说：ActiveRecord::Base.connection.execute执行结果是Mysql2::Result的一个实例，这个类提供很多将执行结果解析出来的方法，例如：to_set、each、collect等，Mysql2::Result这些返回的一般都是数组，直接里面的元素的排序是按照数据库中字段的顺序排列的，按照数组的index直接取。 例如: results = ActiveRecord::Base.connection&#40;&#34;SELECT * FROM `users`&#34;&#41; results.each do &#124;result&#124; &#40;0..&#40;result.size -1&#41; do &#124;index&#124; puts result&#91;index&#93; end end 您可能感兴趣的文章 ruby p3p协议 ruby 中 include 与 extend 区别 rails3.0怪异的数据库密码配置 rails项目开发环境一定要与服务器生产环境一致 rails redirect_to image_tag render partial validates_inclusion_of 使用ri查看Rails的API 为gem添加源]]></description>
			<content:encoded><![CDATA[<p>拿mysql2这个gem来说：ActiveRecord::Base.connection.execute执行结果是Mysql2::Result的一个实例，这个类提供很多将执行结果解析出来的方法，例如：to_set、each、collect等，Mysql2::Result这些返回的一般都是数组，直接里面的元素的排序是按照数据库中字段的顺序排列的，按照数组的index直接取。 例如:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">results = <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>.<span style="color:#9900CC;">connection</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;SELECT * FROM `users`&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
results.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>result<span style="color:#006600; font-weight:bold;">|</span>
   <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span>..<span style="color:#006600; font-weight:bold;">&#40;</span>result.<span style="color:#9900CC;">size</span> <span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>index<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> result<span style="color:#006600; font-weight:bold;">&#91;</span>index<span style="color:#006600; font-weight:bold;">&#93;</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/ruby-p3p-def/' rel='bookmark' title='ruby p3p协议'>ruby p3p协议</a></li>
<li><a href='http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/' rel='bookmark' title='ruby 中 include 与 extend 区别'>ruby 中 include 与 extend 区别</a></li>
<li><a href='http://www.gagahappy.com/rails3-passwd-must-to-be-string-format/' rel='bookmark' title='rails3.0怪异的数据库密码配置'>rails3.0怪异的数据库密码配置</a></li>
<li><a href='http://www.gagahappy.com/rails-dev-production/' rel='bookmark' title='rails项目开发环境一定要与服务器生产环境一致'>rails项目开发环境一定要与服务器生产环境一致</a></li>
<li><a href='http://www.gagahappy.com/rails-redirect_to/' rel='bookmark' title='rails redirect_to'>rails redirect_to</a></li>
<li><a href='http://www.gagahappy.com/image_tag/' rel='bookmark' title='image_tag'>image_tag</a></li>
<li><a href='http://www.gagahappy.com/render-partial/' rel='bookmark' title='render partial'>render partial</a></li>
<li><a href='http://www.gagahappy.com/validates_inclusion_of/' rel='bookmark' title='validates_inclusion_of'>validates_inclusion_of</a></li>
<li><a href='http://www.gagahappy.com/ri-rails-api/' rel='bookmark' title='使用ri查看Rails的API'>使用ri查看Rails的API</a></li>
<li><a href='http://www.gagahappy.com/add-gem-sources/' rel='bookmark' title='为gem添加源'>为gem添加源</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/activerecordbase-connection-executes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ruby p3p协议</title>
		<link>http://www.gagahappy.com/ruby-p3p-def/</link>
		<comments>http://www.gagahappy.com/ruby-p3p-def/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 02:54:36 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3953</guid>
		<description><![CDATA[def p3p headers&#91;'P3P'&#93; = &#34;policyref=\&#34;/w3c/p3p.xml\&#34;, CP=\&#34;ALL DSP COR CURa ADMa DEVa TAIa OUR BUS IND UNI COM NAV INT\&#34;&#34; end 您可能感兴趣的文章 ruby 中 include 与 extend 区别 Python赢得Tiobe 2010年度语言大奖 ruby 安装 rmagick rails redirect_to XPath render partial validates_inclusion_of 使用ri查看Rails的API 为gem添加源 strftime函数将时间格式化]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> p3p
    headers<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'P3P'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">&quot;policyref=<span style="color:#000099;">\&quot;</span>/w3c/p3p.xml<span style="color:#000099;">\&quot;</span>, CP=<span style="color:#000099;">\&quot;</span>ALL DSP COR CURa ADMa DEVa TAIa OUR BUS IND UNI COM NAV INT<span style="color:#000099;">\&quot;</span>&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/' rel='bookmark' title='ruby 中 include 与 extend 区别'>ruby 中 include 与 extend 区别</a></li>
<li><a href='http://www.gagahappy.com/python-tiobe-award/' rel='bookmark' title='Python赢得Tiobe 2010年度语言大奖'>Python赢得Tiobe 2010年度语言大奖</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/rails-redirect_to/' rel='bookmark' title='rails redirect_to'>rails redirect_to</a></li>
<li><a href='http://www.gagahappy.com/xpath/' rel='bookmark' title='XPath'>XPath</a></li>
<li><a href='http://www.gagahappy.com/render-partial/' rel='bookmark' title='render partial'>render partial</a></li>
<li><a href='http://www.gagahappy.com/validates_inclusion_of/' rel='bookmark' title='validates_inclusion_of'>validates_inclusion_of</a></li>
<li><a href='http://www.gagahappy.com/ri-rails-api/' rel='bookmark' title='使用ri查看Rails的API'>使用ri查看Rails的API</a></li>
<li><a href='http://www.gagahappy.com/add-gem-sources/' rel='bookmark' title='为gem添加源'>为gem添加源</a></li>
<li><a href='http://www.gagahappy.com/strftime/' rel='bookmark' title='strftime函数将时间格式化'>strftime函数将时间格式化</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/ruby-p3p-def/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rails 加载schema到指定环境</title>
		<link>http://www.gagahappy.com/rails-load-schema/</link>
		<comments>http://www.gagahappy.com/rails-load-schema/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 16:06:23 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3943</guid>
		<description><![CDATA[rake db:schema:load RAILS_ENV=production 您可能感兴趣的文章 rails 页面缓存路径 ruby 中 include 与 extend 区别 rails3.0 安装mysql2 失败，发生lmysqlclient 错误 rails3.0怪异的数据库密码配置 rake db:migrate CREATE TABLE `schema_migrations` ruby 安装 rmagick rails redirect_to render partial rails2.0快速体验 为gem添加源]]></description>
			<content:encoded><![CDATA[<p>rake db:schema:load RAILS_ENV=production</p>
<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/how-rails-caches-page-work/' rel='bookmark' title='rails 页面缓存路径'>rails 页面缓存路径</a></li>
<li><a href='http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/' rel='bookmark' title='ruby 中 include 与 extend 区别'>ruby 中 include 与 extend 区别</a></li>
<li><a href='http://www.gagahappy.com/rails3-0-gem-mysql2-lmysqlclient/' rel='bookmark' title='rails3.0 安装mysql2 失败，发生lmysqlclient 错误'>rails3.0 安装mysql2 失败，发生lmysqlclient 错误</a></li>
<li><a href='http://www.gagahappy.com/rails3-passwd-must-to-be-string-format/' rel='bookmark' title='rails3.0怪异的数据库密码配置'>rails3.0怪异的数据库密码配置</a></li>
<li><a href='http://www.gagahappy.com/rake-dbmigrate-create-table-schema_migrations/' rel='bookmark' title='rake db:migrate CREATE TABLE `schema_migrations`'>rake db:migrate CREATE TABLE `schema_migrations`</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/rails-redirect_to/' rel='bookmark' title='rails redirect_to'>rails redirect_to</a></li>
<li><a href='http://www.gagahappy.com/render-partial/' rel='bookmark' title='render partial'>render partial</a></li>
<li><a href='http://www.gagahappy.com/rails-2-quick-show/' rel='bookmark' title='rails2.0快速体验'>rails2.0快速体验</a></li>
<li><a href='http://www.gagahappy.com/add-gem-sources/' rel='bookmark' title='为gem添加源'>为gem添加源</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/rails-load-schema/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rails validates_presence_of</title>
		<link>http://www.gagahappy.com/rails-validates_presence_of/</link>
		<comments>http://www.gagahappy.com/rails-validates_presence_of/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 08:14:11 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3835</guid>
		<description><![CDATA[validates_presence_of 在对应属性值为false的时候，rails会认为是空，不能通过验证。 rails版本：2.3.5 您可能感兴趣的文章 rails 加载schema到指定环境 rails 页面缓存路径 ruby 中 include 与 extend 区别 rails3.0 安装mysql2 失败，发生lmysqlclient 错误 rails3.0怪异的数据库密码配置 rake db:migrate CREATE TABLE `schema_migrations` ruby 安装 rmagick render partial rails2.0快速体验 为gem添加源]]></description>
			<content:encoded><![CDATA[<p>validates_presence_of<br />
在对应属性值为false的时候，rails会认为是空，不能通过验证。<br />
rails版本：2.3.5</p>
<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/rails-load-schema/' rel='bookmark' title='rails 加载schema到指定环境'>rails 加载schema到指定环境</a></li>
<li><a href='http://www.gagahappy.com/how-rails-caches-page-work/' rel='bookmark' title='rails 页面缓存路径'>rails 页面缓存路径</a></li>
<li><a href='http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/' rel='bookmark' title='ruby 中 include 与 extend 区别'>ruby 中 include 与 extend 区别</a></li>
<li><a href='http://www.gagahappy.com/rails3-0-gem-mysql2-lmysqlclient/' rel='bookmark' title='rails3.0 安装mysql2 失败，发生lmysqlclient 错误'>rails3.0 安装mysql2 失败，发生lmysqlclient 错误</a></li>
<li><a href='http://www.gagahappy.com/rails3-passwd-must-to-be-string-format/' rel='bookmark' title='rails3.0怪异的数据库密码配置'>rails3.0怪异的数据库密码配置</a></li>
<li><a href='http://www.gagahappy.com/rake-dbmigrate-create-table-schema_migrations/' rel='bookmark' title='rake db:migrate CREATE TABLE `schema_migrations`'>rake db:migrate CREATE TABLE `schema_migrations`</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/render-partial/' rel='bookmark' title='render partial'>render partial</a></li>
<li><a href='http://www.gagahappy.com/rails-2-quick-show/' rel='bookmark' title='rails2.0快速体验'>rails2.0快速体验</a></li>
<li><a href='http://www.gagahappy.com/add-gem-sources/' rel='bookmark' title='为gem添加源'>为gem添加源</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/rails-validates_presence_of/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rails memcache config</title>
		<link>http://www.gagahappy.com/rails-memcache-config/</link>
		<comments>http://www.gagahappy.com/rails-memcache-config/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 05:53:41 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3815</guid>
		<description><![CDATA[config.gem &#34;cached_model&#34; require 'memcache' memcache_options = &#123; :c_threshold =&#62; 10_000, :compression =&#62; true, :debug =&#62;false, :namespace =&#62; 'my_rails_app', :readonly =&#62; false, :urlencode =&#62;false &#125; &#160; CACHE = MemCache.new memcache_options CACHE.servers = &#91;'localhost:11211', 'localhost:11212'&#93; 您可能感兴趣的文章 rails 加载schema到指定环境 rails validates_presence_of rails 页面缓存路径 ruby 中 include 与 extend 区别 rails3.0 安装mysql2 失败，发生lmysqlclient 错误 rails3.0怪异的数据库密码配置 rake db:migrate CREATE TABLE [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">config.<span style="color:#9900CC;">gem</span> <span style="color:#996600;">&quot;cached_model&quot;</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'memcache'</span>
memcache_options = <span style="color:#006600; font-weight:bold;">&#123;</span>
<span style="color:#ff3333; font-weight:bold;">:c_threshold</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">10</span>_000,
<span style="color:#ff3333; font-weight:bold;">:compression</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>,
<span style="color:#ff3333; font-weight:bold;">:debug</span> <span style="color:#006600; font-weight:bold;">=&gt;</span>false,
<span style="color:#ff3333; font-weight:bold;">:namespace</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'my_rails_app'</span>,
<span style="color:#ff3333; font-weight:bold;">:readonly</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>,
<span style="color:#ff3333; font-weight:bold;">:urlencode</span> <span style="color:#006600; font-weight:bold;">=&gt;</span>false
<span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
CACHE = MemCache.<span style="color:#5A0A0A; font-weight:bold;">new</span> memcache_options
CACHE.<span style="color:#9900CC;">servers</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'localhost:11211'</span>, <span style="color:#996600;">'localhost:11212'</span><span style="color:#006600; font-weight:bold;">&#93;</span></pre></div></div>

<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/rails-load-schema/' rel='bookmark' title='rails 加载schema到指定环境'>rails 加载schema到指定环境</a></li>
<li><a href='http://www.gagahappy.com/rails-validates_presence_of/' rel='bookmark' title='rails validates_presence_of'>rails validates_presence_of</a></li>
<li><a href='http://www.gagahappy.com/how-rails-caches-page-work/' rel='bookmark' title='rails 页面缓存路径'>rails 页面缓存路径</a></li>
<li><a href='http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/' rel='bookmark' title='ruby 中 include 与 extend 区别'>ruby 中 include 与 extend 区别</a></li>
<li><a href='http://www.gagahappy.com/rails3-0-gem-mysql2-lmysqlclient/' rel='bookmark' title='rails3.0 安装mysql2 失败，发生lmysqlclient 错误'>rails3.0 安装mysql2 失败，发生lmysqlclient 错误</a></li>
<li><a href='http://www.gagahappy.com/rails3-passwd-must-to-be-string-format/' rel='bookmark' title='rails3.0怪异的数据库密码配置'>rails3.0怪异的数据库密码配置</a></li>
<li><a href='http://www.gagahappy.com/rake-dbmigrate-create-table-schema_migrations/' rel='bookmark' title='rake db:migrate CREATE TABLE `schema_migrations`'>rake db:migrate CREATE TABLE `schema_migrations`</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/rails-2-quick-show/' rel='bookmark' title='rails2.0快速体验'>rails2.0快速体验</a></li>
<li><a href='http://www.gagahappy.com/add-gem-sources/' rel='bookmark' title='为gem添加源'>为gem添加源</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/rails-memcache-config/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rails 页面缓存路径</title>
		<link>http://www.gagahappy.com/how-rails-caches-page-work/</link>
		<comments>http://www.gagahappy.com/how-rails-caches-page-work/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 16:01:36 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3783</guid>
		<description><![CDATA[如果使用默认页面缓存设置，在生产环境下，web服务器可以直接访问生成的缓存页面，不再去调用rails。 但是如果修改了默认页面缓的存放位置，又没对web服务器设置相应的规则，web服务器会因找不到页面而再次把请求转发给rails。从而使缓存变得没有意义。 您可能感兴趣的文章 rails 加载schema到指定环境 rails validates_presence_of rails memcache config ruby 中 include 与 extend 区别 rails3.0 安装mysql2 失败，发生lmysqlclient 错误 rails3.0怪异的数据库密码配置 rake db:migrate CREATE TABLE `schema_migrations` ruby 安装 rmagick rails2.0快速体验 为gem添加源]]></description>
			<content:encoded><![CDATA[<p>如果使用默认页面缓存设置，在生产环境下，web服务器可以直接访问生成的缓存页面，不再去调用rails。</p>
<p>但是如果修改了默认页面缓的存放位置，又没对web服务器设置相应的规则，web服务器会因找不到页面而再次把请求转发给rails。从而使缓存变得没有意义。</p>
<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/rails-load-schema/' rel='bookmark' title='rails 加载schema到指定环境'>rails 加载schema到指定环境</a></li>
<li><a href='http://www.gagahappy.com/rails-validates_presence_of/' rel='bookmark' title='rails validates_presence_of'>rails validates_presence_of</a></li>
<li><a href='http://www.gagahappy.com/rails-memcache-config/' rel='bookmark' title='rails memcache config'>rails memcache config</a></li>
<li><a href='http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/' rel='bookmark' title='ruby 中 include 与 extend 区别'>ruby 中 include 与 extend 区别</a></li>
<li><a href='http://www.gagahappy.com/rails3-0-gem-mysql2-lmysqlclient/' rel='bookmark' title='rails3.0 安装mysql2 失败，发生lmysqlclient 错误'>rails3.0 安装mysql2 失败，发生lmysqlclient 错误</a></li>
<li><a href='http://www.gagahappy.com/rails3-passwd-must-to-be-string-format/' rel='bookmark' title='rails3.0怪异的数据库密码配置'>rails3.0怪异的数据库密码配置</a></li>
<li><a href='http://www.gagahappy.com/rake-dbmigrate-create-table-schema_migrations/' rel='bookmark' title='rake db:migrate CREATE TABLE `schema_migrations`'>rake db:migrate CREATE TABLE `schema_migrations`</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/rails-2-quick-show/' rel='bookmark' title='rails2.0快速体验'>rails2.0快速体验</a></li>
<li><a href='http://www.gagahappy.com/add-gem-sources/' rel='bookmark' title='为gem添加源'>为gem添加源</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/how-rails-caches-page-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ruby 中 include 与 extend 区别</title>
		<link>http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/</link>
		<comments>http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 15:36:38 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3669</guid>
		<description><![CDATA[那么include和extend究竟有什么区别的？ 引用如下 include : mixes in specified module methods as instance methods in the target class extend : mixes in specified module methods as class methods in the target class 记得有看过的，被用到的时候居然忘记了。杯具啊！ module A def klass_method puts 'klass method' end &#160; def ins_method puts 'instance method' end &#160; end &#160; class B end &#160; B.class_eval do [...]]]></description>
			<content:encoded><![CDATA[<p>那么include和extend究竟有什么区别的？</p>
<p>引用如下</p>
<blockquote><p>include : mixes in specified module methods as instance methods in the target class<br />
extend : mixes in specified module methods as class methods in the target class</p></blockquote>
<p>记得有看过的，被用到的时候居然忘记了。杯具啊！<br />
<span id="more-3669"></span></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> A
    <span style="color:#9966CC; font-weight:bold;">def</span> klass_method
        <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">'klass method'</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> ins_method
        <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">'instance method'</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> B
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
B.<span style="color:#9900CC;">class_eval</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#9966CC; font-weight:bold;">include</span> A
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
B.<span style="color:#9900CC;">new</span>.<span style="color:#9900CC;">ins_method</span> <span style="color:#008000; font-style:italic;"># 'should puts instance method'</span>
<span style="color:#008000; font-style:italic;">#B.klass_method # 'not define'</span>
&nbsp;
B.<span style="color:#9900CC;">class_eval</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    extend A
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
B.<span style="color:#9900CC;">klass_method</span> <span style="color:#008000; font-style:italic;"># 'klass method'</span>
B.<span style="color:#9900CC;">ins_method</span> <span style="color:#008000; font-style:italic;"># also as class method</span></pre></div></div>

<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/ruby-escape/' rel='bookmark' title='ruby escape'>ruby escape</a></li>
<li><a href='http://www.gagahappy.com/ruby-p3p-def/' rel='bookmark' title='ruby p3p协议'>ruby p3p协议</a></li>
<li><a href='http://www.gagahappy.com/rails-dev-production/' rel='bookmark' title='rails项目开发环境一定要与服务器生产环境一致'>rails项目开发环境一定要与服务器生产环境一致</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/rails-redirect_to/' rel='bookmark' title='rails redirect_to'>rails redirect_to</a></li>
<li><a href='http://www.gagahappy.com/image_tag/' rel='bookmark' title='image_tag'>image_tag</a></li>
<li><a href='http://www.gagahappy.com/render-partial/' rel='bookmark' title='render partial'>render partial</a></li>
<li><a href='http://www.gagahappy.com/validates_inclusion_of/' rel='bookmark' title='validates_inclusion_of'>validates_inclusion_of</a></li>
<li><a href='http://www.gagahappy.com/ri-rails-api/' rel='bookmark' title='使用ri查看Rails的API'>使用ri查看Rails的API</a></li>
<li><a href='http://www.gagahappy.com/add-gem-sources/' rel='bookmark' title='为gem添加源'>为gem添加源</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>安装Rmagick</title>
		<link>http://www.gagahappy.com/rmagick-install/</link>
		<comments>http://www.gagahappy.com/rmagick-install/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 12:21:21 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[我爱Linux]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3755</guid>
		<description><![CDATA[首先下载imagemagick 进入安装目录 cd imagemagick ./configure &#8211;prefix=/opt/imagemagick make sudo make install 如果出现 /usr/bin/ld: cannot find -lperl 请安装 sudo apt-get install libperl-dev 您可能感兴趣的文章 ruby 中 include 与 extend 区别 解决rails2.2.2不能连接mysql 数据库驱动问题 rails3.0怪异的数据库密码配置 ruby 安装 rmagick rails redirect_to ruby 1.8.7 and rails 1.2.2完美匹配 render partial 安装 Sphinx 为gem添加源 strftime函数将时间格式化]]></description>
			<content:encoded><![CDATA[<p>首先下载imagemagick<br />
进入安装目录<br />
cd imagemagick<br />
./configure &#8211;prefix=/opt/imagemagick<br />
make<br />
sudo make install<br />
如果出现<br />
/usr/bin/ld: cannot find -lperl<br />
请安装<br />
sudo apt-get install libperl-dev</p>
<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/the-different-between-include-and-extend-in-ruby/' rel='bookmark' title='ruby 中 include 与 extend 区别'>ruby 中 include 与 extend 区别</a></li>
<li><a href='http://www.gagahappy.com/rails2-2-2-can-not-connect-mysql-drive-bug/' rel='bookmark' title='解决rails2.2.2不能连接mysql 数据库驱动问题'>解决rails2.2.2不能连接mysql 数据库驱动问题</a></li>
<li><a href='http://www.gagahappy.com/rails3-passwd-must-to-be-string-format/' rel='bookmark' title='rails3.0怪异的数据库密码配置'>rails3.0怪异的数据库密码配置</a></li>
<li><a href='http://www.gagahappy.com/ruby-install-rmagick/' rel='bookmark' title='ruby 安装 rmagick'>ruby 安装 rmagick</a></li>
<li><a href='http://www.gagahappy.com/rails-redirect_to/' rel='bookmark' title='rails redirect_to'>rails redirect_to</a></li>
<li><a href='http://www.gagahappy.com/ruby-1-8-7-and-rails-1-2-2/' rel='bookmark' title='ruby 1.8.7 and rails 1.2.2完美匹配'>ruby 1.8.7 and rails 1.2.2完美匹配</a></li>
<li><a href='http://www.gagahappy.com/render-partial/' rel='bookmark' title='render partial'>render partial</a></li>
<li><a href='http://www.gagahappy.com/install-sphinx/' rel='bookmark' title='安装 Sphinx'>安装 Sphinx</a></li>
<li><a href='http://www.gagahappy.com/add-gem-sources/' rel='bookmark' title='为gem添加源'>为gem添加源</a></li>
<li><a href='http://www.gagahappy.com/strftime/' rel='bookmark' title='strftime函数将时间格式化'>strftime函数将时间格式化</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/rmagick-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决rails2.2.2不能连接mysql 数据库驱动问题</title>
		<link>http://www.gagahappy.com/rails2-2-2-can-not-connect-mysql-drive-bug/</link>
		<comments>http://www.gagahappy.com/rails2-2-2-can-not-connect-mysql-drive-bug/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 09:56:36 +0000</pubDate>
		<dc:creator>moonfox</dc:creator>
				<category><![CDATA[我爱Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.gagahappy.com/?p=3737</guid>
		<description><![CDATA[gem install mysql &#8212; &#8211;with-mysql-config=/usr/local/mysql/bin/mysql_config 1. gem install mysql &#8211;no-rdoc &#8211;no-ri \ 2. &#8212; &#8211;with-mysql-include=/usr/local/mysql/include \ 3. &#8211;with-mysql-lib=/usr/local/mysql/lib \ 4. &#8211;with-mysql-config=/usr/local/mysql/bin/mysql_config &#8220;/usr/local/mysql/lib&#8221; to /etc/ld.so.conf and ran ldconfig 修改 /etc/ld.so.conf 加入 include /opt/mysql/lib gem install mysql &#8212; &#8211;with-mysql-lib=/opt/mysql/lib/mysql &#8211;with-mysql-include=/opt/mysql/include/mysql/ 您可能感兴趣的文章 安装Rmagick 编译安装mysql 编译安装rails rails3.0 安装mysql2 失败，发生lmysqlclient 错误 fedora13 编译安装 mysql no curses/termcap library found mysql 字符串转换成数字 [...]]]></description>
			<content:encoded><![CDATA[<p>gem install mysql &#8212; &#8211;with-mysql-config=/usr/local/mysql/bin/mysql_config</p>
<p>1. gem install mysql &#8211;no-rdoc &#8211;no-ri \<br />
2. &#8212; &#8211;with-mysql-include=/usr/local/mysql/include \<br />
3. &#8211;with-mysql-lib=/usr/local/mysql/lib \<br />
4. &#8211;with-mysql-config=/usr/local/mysql/bin/mysql_config</p>
<p>&#8220;/usr/local/mysql/lib&#8221; to /etc/ld.so.conf and ran ldconfig</p>
<p>修改 /etc/ld.so.conf<br />
加入<br />
include /opt/mysql/lib</p>
<p>gem install mysql &#8212; &#8211;with-mysql-lib=/opt/mysql/lib/mysql &#8211;with-mysql-include=/opt/mysql/include/mysql/</p>
<p>您可能感兴趣的文章<ol>
<li><a href='http://www.gagahappy.com/rmagick-install/' rel='bookmark' title='安装Rmagick'>安装Rmagick</a></li>
<li><a href='http://www.gagahappy.com/mysql-install-with-make-install/' rel='bookmark' title='编译安装mysql'>编译安装mysql</a></li>
<li><a href='http://www.gagahappy.com/rails-install-with-make-install/' rel='bookmark' title='编译安装rails'>编译安装rails</a></li>
<li><a href='http://www.gagahappy.com/rails3-0-gem-mysql2-lmysqlclient/' rel='bookmark' title='rails3.0 安装mysql2 失败，发生lmysqlclient 错误'>rails3.0 安装mysql2 失败，发生lmysqlclient 错误</a></li>
<li><a href='http://www.gagahappy.com/fedora13-mysql-no-cursestermcap-library-found/' rel='bookmark' title='fedora13 编译安装 mysql no curses/termcap library found'>fedora13 编译安装 mysql no curses/termcap library found</a></li>
<li><a href='http://www.gagahappy.com/mysql-string-cast-to-number/' rel='bookmark' title='mysql 字符串转换成数字'>mysql 字符串转换成数字</a></li>
<li><a href='http://www.gagahappy.com/ubuntu-remove-mysql-service/' rel='bookmark' title='Ubuntu 取消 mysql开机启动服务'>Ubuntu 取消 mysql开机启动服务</a></li>
<li><a href='http://www.gagahappy.com/install-sphinx/' rel='bookmark' title='安装 Sphinx'>安装 Sphinx</a></li>
<li><a href='http://www.gagahappy.com/rails-2-quick-show/' rel='bookmark' title='rails2.0快速体验'>rails2.0快速体验</a></li>
<li><a href='http://www.gagahappy.com/ubuntu-mysql-add-to-service/' rel='bookmark' title='ubuntu mysql 自动启动'>ubuntu mysql 自动启动</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gagahappy.com/rails2-2-2-can-not-connect-mysql-drive-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

