<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>kafka0102 (kafka0102)</title>
    <link>https://ruby-china.org/kafka0102</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>做了一个开源项目库聚合的产品</title>
      <description>&lt;p&gt;最近做的一个东西（&lt;a href="http://www.opendigg.com/" rel="nofollow" target="_blank" title=""&gt;OpenDigg&lt;/a&gt;），针对 Github 上的开源项目进行分类整合。呈现方式类似于 ProductHunt，当然也有在不断整理一些经典项目。&lt;br&gt;&lt;br&gt;
网站本来打算用 Node 写，后来想想开发周期，还是换成顺手的 Rails。做了一个多月的数据，感觉还是安卓、Swift、前端方面的项目多，后端语言里 Python 比较多（主要集中在爬虫和数据挖掘方面）。&lt;br&gt;
&lt;br&gt;
有空的朋友可以定期来看看，也许就有你用得上的项目。也欢迎给我们提交项目。&lt;br&gt;&lt;/p&gt;</description>
      <author>kafka0102</author>
      <pubDate>Tue, 03 Jan 2017 15:44:52 +0800</pubDate>
      <link>https://ruby-china.org/topics/32047</link>
      <guid>https://ruby-china.org/topics/32047</guid>
    </item>
    <item>
      <title>Nginx + Unicorn 部署重启的性能问题</title>
      <description>&lt;p&gt;配置是 8G 内存 +2 核 CPU 的云主机，12 个 nginx 进程，unicorn 的 worker 是 20 个。&lt;/p&gt;

&lt;p&gt;发布新版本时先&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后 &lt;code&gt;rake stop&lt;/code&gt; 大概需要 10 几秒钟，之后 &lt;code&gt;rake start&lt;/code&gt; 又是 10 几秒。&lt;/p&gt;

&lt;p&gt;问题似乎在并发多时（低峰期也有每秒 10 多个请求），&lt;code&gt;rake start&lt;/code&gt; 后 cpu 就满了，看 rails log 是有处理请求的，但 nginx 基本就是 499 和 502 之类的响应。&lt;/p&gt;

&lt;p&gt;尝试的解决方法是，kill 掉 nginx 进程，重新 start unicorn 再 start nginx 后恢复正常了。而且，看 rails log 有时会有 missing views 文件的信息（这个很让人费解，因为文件是存在的）。如果部署时并发不多就不会出现这种问题。个人猜测，因为请求比较多，unicorn 启动后 20 个 worker 进程同时处理请求，但因为加载 rails 环境什么的都在占用资源，结果是很多 worker 都没有起来（log 里有 killed 的日志）。我在想，配置再升级到 4 核 CPU 是否能好些？但平时 CPU 利用率只是 30% 左右的。现在每次部署都很闹心啊，该如何能只几十秒停服务的部署啊？&lt;/p&gt;</description>
      <author>kafka0102</author>
      <pubDate>Sun, 17 Apr 2016 22:11:40 +0800</pubDate>
      <link>https://ruby-china.org/topics/29751</link>
      <guid>https://ruby-china.org/topics/29751</guid>
    </item>
    <item>
      <title>[北京] 创业团队诚寻 Ruby 队友（可实习）</title>
      <description>&lt;p&gt;我们是一个奋斗在北京沙河大三居的 3 全职 1 兼职的小创业团队，创业的产品是面向 IT 圈的个性化阅读产品&lt;a href="http://www.tuicool.com" rel="nofollow" target="_blank"&gt;http://www.tuicool.com&lt;/a&gt; 。现为了更好发展，寻找一位做 Rails 开发的队友。工作要求如下：&lt;/p&gt;

&lt;p&gt;1、创业早期，需要你能有创业精神，并能有很好的自学能力驱动自己成长。&lt;/p&gt;

&lt;p&gt;2、有 Rails 实际项目经验（如果前端牛逼，有 Rails 基础也可），可独立完成功能开发。&lt;/p&gt;

&lt;p&gt;3、如果有 Java 后端开发经验更好。&lt;/p&gt;

&lt;p&gt;4、创业团队，待遇方面以工资配股份，工资在 4K-8K，股份为 x%。如果你是技术牛人有创业意愿，股份可以再谈。&lt;/p&gt;

&lt;p&gt;5、如果能长期实习，也欢迎加入，实习要求有 Rails 开发基础。&lt;/p&gt;

&lt;p&gt;6、简历可投递至邮箱 kafka0102@163.com&lt;/p&gt;</description>
      <author>kafka0102</author>
      <pubDate>Wed, 16 Jul 2014 10:44:36 +0800</pubDate>
      <link>https://ruby-china.org/topics/20516</link>
      <guid>https://ruby-china.org/topics/20516</guid>
    </item>
    <item>
      <title>[北京] 创业团队诚寻 Ruby 队友</title>
      <description>&lt;p&gt;我们是一个奋斗在北京沙河大三居的小创业团队，创业的产品是面向 IT 圈的个性化阅读产品&lt;a href="http://www.tuicool.com" rel="nofollow" target="_blank"&gt;http://www.tuicool.com&lt;/a&gt; 。现为了更好发展，寻找一位做 Rails 开发的队友。工作要求如下：&lt;/p&gt;

&lt;p&gt;1、创业早期，需要你能有创业精神（你懂的），并能有很好的自学能力驱动自己成长。&lt;/p&gt;

&lt;p&gt;2、有 Rails 实际项目经验（如果前端牛逼，有 Rails 基础也可），可独立完成功能开发。&lt;/p&gt;

&lt;p&gt;3、如果有 Java 后端开发经验更好。&lt;/p&gt;

&lt;p&gt;4、创业团队，待遇方面以工资配股份，工资在 4K-8K，股份为 x%。如果你是技术牛人有创业意愿，股份可以再谈。&lt;/p&gt;

&lt;p&gt;5、如果能长期实习，也欢迎加入。&lt;/p&gt;

&lt;p&gt;6、简历可投递至邮箱 kafka0102@163.com&lt;/p&gt;

&lt;p&gt;PS: 做技术的亲们也可以使用下我们的网站/客户端，还有我们诚意打造的技术周刊：&lt;a href="http://www.tuicool.com/mags" rel="nofollow" target="_blank"&gt;http://www.tuicool.com/mags&lt;/a&gt;&lt;/p&gt;</description>
      <author>kafka0102</author>
      <pubDate>Mon, 02 Jun 2014 00:20:57 +0800</pubDate>
      <link>https://ruby-china.org/topics/19674</link>
      <guid>https://ruby-china.org/topics/19674</guid>
    </item>
    <item>
      <title>[广告贴]# 编程狂人 # 周刊第 21 期</title>
      <description>&lt;p&gt;想想好久没在这发贴啦（都是我同事发广告），今天自己发一个。我们的编程狂人新一期来了：&lt;a href="http://www.tuicool.com/mags/53548155d91b144bdb02a865" rel="nofollow" target="_blank"&gt;http://www.tuicool.com/mags/53548155d91b144bdb02a865&lt;/a&gt; 我们利用算法将过去一周的好文章做个排序，然后个人花 2-3 小时筛选出来，内容上还是不错的。这一期的 PDF 排版也做得很好，适合 pad 上阅读。为了推周刊，除了四处发贴当然也要做点活动（毫无新意的转发送书活动）：&lt;a href="http://weibo.com/2609648351/B0TB3tW9N" rel="nofollow" target="_blank"&gt;http://weibo.com/2609648351/B0TB3tW9N&lt;/a&gt; 有兴趣没兴趣都可以看看。&lt;/p&gt;</description>
      <author>kafka0102</author>
      <pubDate>Tue, 22 Apr 2014 17:35:02 +0800</pubDate>
      <link>https://ruby-china.org/topics/18774</link>
      <guid>https://ruby-china.org/topics/18774</guid>
    </item>
    <item>
      <title>[北京] 创业团队寻找 ruby 队友</title>
      <description>&lt;p&gt;&lt;strong&gt;我们是谁&lt;/strong&gt;
我们在做的是面向 IT 圈的个性化阅读产品：&lt;a href="http://www.tuicool.com/" rel="nofollow" target="_blank"&gt;http://www.tuicool.com/&lt;/a&gt; 就是根据你的阅读偏好推荐给你感兴趣的文章，之前在这里也发过几个帖子了。我们现在 3 人，在北京昌平沙河的大三居吃住办公，偶尔会去车库咖啡转转。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;职位情况&lt;/strong&gt;
现在想找一个做 ruby 的朋友加入，提供住宿和基本的工资。因为是创业阶段，所以不会像正规公司那么多福利，但相对来说工作会更自由些（尽管创业苦逼，但工作负荷不会太过分的，正常作息即可）。要求来说，前端技术期望能好些，能把我们现在的网站做的更漂亮些，ruby 方面需要有独立的开发能力（如果前端很好，ruby 方面可以现学亦可）。能长期过来实习的也可以。&lt;/p&gt;

&lt;p&gt;有兴趣的可以将简历发到我邮箱：kafka0102@163.com。&lt;/p&gt;

&lt;p&gt;另外，我们也在寻找兼职的设计帮忙做些东西（比如海报宣传册之类的），有这方面经验的朋友也可以推荐给我们。&lt;/p&gt;</description>
      <author>kafka0102</author>
      <pubDate>Fri, 27 Sep 2013 15:40:17 +0800</pubDate>
      <link>https://ruby-china.org/topics/14434</link>
      <guid>https://ruby-china.org/topics/14434</guid>
    </item>
    <item>
      <title>推酷送书活动</title>
      <description>&lt;p&gt;我们在做一个送书的活动，书是我们自己的，多数还算比较新，提供包邮。送的书大概 100 本左右，技术类的和人文类各半。活动地址是 &lt;a href="http://www.tuicool.com/septs" rel="nofollow" target="_blank"&gt;http://www.tuicool.com/septs&lt;/a&gt; ruby china 的朋友如果参加活动，可以把用户贴上来，尽量照顾啦。&lt;/p&gt;</description>
      <author>kafka0102</author>
      <pubDate>Fri, 13 Sep 2013 15:43:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/14100</link>
      <guid>https://ruby-china.org/topics/14100</guid>
    </item>
    <item>
      <title>创业团队再寻人</title>
      <description>&lt;p&gt;半年多前在这发过一个帖子，那时拿到孵化器的种子资金，团队从一个人“扩张”到 3 个人，后来又理性的回归到两个人。目前拿到了追加的投资（算不上很多），想再寻一两个人把团队建设起来。产品是推酷：&lt;a href="http://www.tuicool.com" rel="nofollow" target="_blank"&gt;http://www.tuicool.com&lt;/a&gt; 面向 IT 领域的个性化推荐产品。考虑到资金情况以及长久的发展，在待遇上目前只能提供基本的生活工资，但会提供核心团队成员的股份。我们的技术主要包含 Ruby（Web）、Android、iOS 和 Java 后端，每个人会负责至少一个方向的较独立开发。要求上，你不必有牛逼的学历背景，但是做事要靠谱能吃苦，热爱技术能自我驱动学习把技术和产品做好。把产品做好的前提是技术能跟上，所以如果你是刚毕业的或是经验不是很丰富，我会每周交给你一些学习任务，这就要求你能加班看书看文档看代码。我们还没有成立公司，福利方面就是每周末会改善一下伙食，平时需要的话也提供水果饮料之类的。目前我们在大连（这里有免费的办公室，环境也还不错），计划是 7、8 月份去北京。如果有感兴趣的，兼职或是实习的我们也欢迎（实习的话要求人在大连，实际上，团队的另一人现在全职实习，但毕业后角色会升级一下）。如果有擅长设计或是运营方面的，也欢迎兼职加入我们。&lt;/p&gt;</description>
      <author>kafka0102</author>
      <pubDate>Thu, 14 Mar 2013 16:35:29 +0800</pubDate>
      <link>https://ruby-china.org/topics/9419</link>
      <guid>https://ruby-china.org/topics/9419</guid>
    </item>
    <item>
      <title>[大连][北京] 推酷网诚寻战友</title>
      <description>&lt;p&gt;推酷网（www.tuicool.com）是面向 IT 垂直领域的个性化阅读产品（产品的更多介绍请参考网站的“关于”页面）。推酷目前加入到国外一家孵化机构的孵化计划，该孵化计划于 8 月到 10 月这 3 个月在大连进行集中开发（提供住宿），之后会返回北京继续开发（亦解决住宿问题）。&lt;/p&gt;

&lt;p&gt;为了使推酷更快的发展，现寻两人组团战斗。需要的技术主要有三方面：1）前端开发，也即 html/css，少量的 JS 应用，会些简单的 UI 设计更好。2）Web 开发，即 Ruby on Rails 开发，如果有其他语言的 Web 开发经验，有志转向 ROR 亦可。3）Android 开发，有一定的 Java 经验亦可。对于上述技能，擅长任何一方面都可（也可在工作中学习多方面的技术）。就工作量来说，其实不是特别大，所以你可以没有丰富的工作经验，但要求能自我驱动学习（技术上我可以给予一定指导），通过不断的提高技术把产品做得更好。&lt;/p&gt;

&lt;p&gt;目前推酷可以提供的月薪在 3000-6000，如果愿意一起创业，可提供丰厚的股份。如果你是个实习生，要求至少能实习到 11 月初（这段经历相信会使你的技术水平有个快速提高）。有意向的朋友可以发个人简历（不用太正式）到邮箱 kafka0102@163.com。  &lt;/p&gt;</description>
      <author>kafka0102</author>
      <pubDate>Thu, 12 Jul 2012 19:10:06 +0800</pubDate>
      <link>https://ruby-china.org/topics/4278</link>
      <guid>https://ruby-china.org/topics/4278</guid>
    </item>
    <item>
      <title>推酷网内测，借地宣传下</title>
      <description>&lt;p&gt;推酷网是面向 IT 人（目前申请注册的主要以程序员为主了）的个性化阅读产品，系统会根据你的兴趣准实时推荐中英文的业界资讯、技术文章、产品设计等方面内容。目前核心功能已基本实现，邀请热心网友们内测下。网站目前是我一个人全职在做，其中 web 部分是 Rails 开发的，所以在这里也宣传下，有创业意愿的技术朋友可以联系我一起战斗。。。
ps：网址是&lt;a href="http://www.tuicool.com" rel="nofollow" target="_blank"&gt;http://www.tuicool.com&lt;/a&gt;  &lt;/p&gt;</description>
      <author>kafka0102</author>
      <pubDate>Wed, 28 Mar 2012 17:38:14 +0800</pubDate>
      <link>https://ruby-china.org/topics/2207</link>
      <guid>https://ruby-china.org/topics/2207</guid>
    </item>
    <item>
      <title>Rails 下的长久运行的任务脚本怎么做成后台进程运行？</title>
      <description>&lt;p&gt;一个日志监控的代码，一开始想用 rake 执行，但是似乎只能前台运行？没 google 出解决办法，现在放到 unit test 里，能后台执行了，但感觉好 2，有更好的解决方案不？  &lt;/p&gt;</description>
      <author>kafka0102</author>
      <pubDate>Tue, 27 Mar 2012 16:31:42 +0800</pubDate>
      <link>https://ruby-china.org/topics/2172</link>
      <guid>https://ruby-china.org/topics/2172</guid>
    </item>
    <item>
      <title>求助！product 环境下出错时不能 log 出错信息</title>
      <description>&lt;p&gt;对于程序异常（或者 404）情况，我进行了捕捉处理，出错时会打出栈信息，development 环境下是 ok 的，但 product 下就不行。
相关代码就是 application_controller 下的：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nc"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rescue_errors&lt;/span&gt;
  &lt;span class="k"&gt;unless&lt;/span&gt; &lt;span class="no"&gt;Rails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;consider_all_requests_local&lt;/span&gt;
    &lt;span class="n"&gt;rescue_from&lt;/span&gt; &lt;span class="no"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                            &lt;span class="ss"&gt;:with&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:render_500&lt;/span&gt;
    &lt;span class="n"&gt;rescue_from&lt;/span&gt; &lt;span class="no"&gt;RuntimeError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                         &lt;span class="ss"&gt;:with&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:render_500&lt;/span&gt;
    &lt;span class="n"&gt;rescue_from&lt;/span&gt; &lt;span class="no"&gt;ActionController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;RoutingError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;       &lt;span class="ss"&gt;:with&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:render_404&lt;/span&gt;
    &lt;span class="n"&gt;rescue_from&lt;/span&gt; &lt;span class="no"&gt;ActionController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;UnknownController&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="ss"&gt;:with&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:render_404&lt;/span&gt;
    &lt;span class="n"&gt;rescue_from&lt;/span&gt; &lt;span class="no"&gt;ActionController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;UnknownAction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="ss"&gt;:with&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:render_404&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="n"&gt;rescue_errors&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;render_500&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exception&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exception&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;message&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;exception&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;backtrace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="n"&gt;render_optional_error_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;render_404&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;render_optional_error_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;render_optional_error_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="vi"&gt;@title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"出错了！"&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
    &lt;span class="vi"&gt;@message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;
  &lt;span class="k"&gt;elsif&lt;/span&gt; &lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;404&lt;/span&gt;
    &lt;span class="vi"&gt;@message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"页面不存在."&lt;/span&gt;
  &lt;span class="k"&gt;elsif&lt;/span&gt; &lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;403&lt;/span&gt;
    &lt;span class="vi"&gt;@message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"权限被拒绝."&lt;/span&gt;
  &lt;span class="k"&gt;elsif&lt;/span&gt; &lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;
    &lt;span class="vi"&gt;@message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"系统错误，请稍候光临."&lt;/span&gt;
  &lt;span class="k"&gt;elsif&lt;/span&gt; &lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;503&lt;/span&gt;
    &lt;span class="vi"&gt;@message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"系统抢修中，稍候回来."&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="vi"&gt;@message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"未知错误，请稍候光临."&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="ss"&gt;:template&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"/errors/error"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="ss"&gt;:format&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:html&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="ss"&gt;:handler&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:erb&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="ss"&gt;:status&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="ss"&gt;:layout&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"application"&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在 product 时页面能正常实现出错提示信息，说明已经调用 render_optional_error_file(500) 了，但它上面的 log 就出不来，我试了打出 info 信息也不行。。。。。&lt;/p&gt;

&lt;p&gt;还有个郁闷的情况，也是 product 环境，发现有 2b 请求时框架打出异常了，但提示没搞明白，因为 errors/error模版文件是存在的，是由:formats=&amp;gt;[:png], :handlers=&amp;gt;[:erb, :builder] 这个造成的？？。。。。。&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Started GET &lt;span class="s2"&gt;"/cms/uploads/allimg/120209/3866_120209095905_1.png"&lt;/span&gt; &lt;span class="k"&gt;for &lt;/span&gt;216.24.204.228 at 2012-03-19 12:06:52 +0800
2012-03-19 12:06:52     FATAL    &lt;span class="nt"&gt;--&lt;/span&gt; 
ActionView::MissingTemplate &lt;span class="o"&gt;(&lt;/span&gt;Missing template errors/error with &lt;span class="o"&gt;{&lt;/span&gt;:locale&lt;span class="o"&gt;=&amp;gt;[&lt;/span&gt;:en], :formats&lt;span class="o"&gt;=&amp;gt;[&lt;/span&gt;:png], :handlers&lt;span class="o"&gt;=&amp;gt;[&lt;/span&gt;:erb, :builder]&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt; Searched &lt;span class="k"&gt;in&lt;/span&gt;:
  &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="s2"&gt;"/home/tuicool/app/lemon/app/views"&lt;/span&gt;
&lt;span class="o"&gt;)&lt;/span&gt;:
  app/controllers/application_controller.rb:63:in &lt;span class="sb"&gt;`&lt;/span&gt;render_optional_error_file&lt;span class="s1"&gt;'
  app/controllers/application_controller.rb:33:in `render_500'&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;</description>
      <author>kafka0102</author>
      <pubDate>Mon, 19 Mar 2012 12:25:20 +0800</pubDate>
      <link>https://ruby-china.org/topics/1964</link>
      <guid>https://ruby-china.org/topics/1964</guid>
    </item>
  </channel>
</rss>
