<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>alucardpj</title>
    <link>https://ruby-china.org/alucardpj</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>�GitHub 挂了？</title>
      <description>&lt;p&gt;我这里访问出现了 unicorn 报错页
&lt;img src="https://l.ruby-china.com/photo/2016/025171b750ca6ec7965fc60c5b838ffb.png" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Thu, 28 Jan 2016 09:58:27 +0800</pubDate>
      <link>https://ruby-china.org/topics/28891</link>
      <guid>https://ruby-china.org/topics/28891</guid>
    </item>
    <item>
      <title>今天 ruby-china 访问特别慢啊，刷了几次还报了这个错误</title>
      <description>&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2016/252ee630b55c2a492fb9967a25e9bf6b.png" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Tue, 26 Jan 2016 09:33:36 +0800</pubDate>
      <link>https://ruby-china.org/topics/28852</link>
      <guid>https://ruby-china.org/topics/28852</guid>
    </item>
    <item>
      <title>很荣幸和 ruby-china 一起过生日</title>
      <description>&lt;p&gt;祝 ruby-china 越办越好！&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Wed, 28 Oct 2015 00:24:30 +0800</pubDate>
      <link>https://ruby-china.org/topics/27858</link>
      <guid>https://ruby-china.org/topics/27858</guid>
    </item>
    <item>
      <title>Ruby China SSL 证书的小 issue</title>
      <description>&lt;p&gt;今天测试站点的 ssl 证书链的时候顺手测了一下 ruby-china 的证书，发现把 root 根证书也传上去了
&lt;a href="https://www.ssllabs.com/ssltest/analyze.html?d=ruby-china.org" rel="nofollow" target="_blank"&gt;https://www.ssllabs.com/ssltest/analyze.html?d=ruby-china.org&lt;/a&gt;
&lt;img src="https://l.ruby-china.com/photo/2015/10ff59c9acaea5b5228a3bf31ad9af8d.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;根据这篇文章说的，rootCA 是不需要加到证书链中的
&lt;a href="http://www.idongu.com/articles/823" rel="nofollow" target="_blank"&gt;http://www.idongu.com/articles/823&lt;/a&gt;&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Mon, 01 Jun 2015 19:27:33 +0800</pubDate>
      <link>https://ruby-china.org/topics/25838</link>
      <guid>https://ruby-china.org/topics/25838</guid>
    </item>
    <item>
      <title>railscast-china 打不开了？</title>
      <description>&lt;p&gt;打开以后大白页啥也没有。
&lt;a href="http://railscasts-china.com/" rel="nofollow" target="_blank"&gt;http://railscasts-china.com/&lt;/a&gt;&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Fri, 05 Dec 2014 10:07:36 +0800</pubDate>
      <link>https://ruby-china.org/topics/23038</link>
      <guid>https://ruby-china.org/topics/23038</guid>
    </item>
    <item>
      <title>rails 4.2.0 beta1 在 taobao 源上安装时报错</title>
      <description>&lt;p&gt;gem install rails --pre
在 taobao 源上会报错，在 rubygem 原始源上没问题&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Wed, 03 Sep 2014 18:39:35 +0800</pubDate>
      <link>https://ruby-china.org/topics/21368</link>
      <guid>https://ruby-china.org/topics/21368</guid>
    </item>
    <item>
      <title>这两天 ruby-china 首页的样式一直在调整啊</title>
      <description>&lt;p&gt;一会竖排一列，一会竖排两列带头像。&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Mon, 02 Sep 2013 14:50:37 +0800</pubDate>
      <link>https://ruby-china.org/topics/13824</link>
      <guid>https://ruby-china.org/topics/13824</guid>
    </item>
    <item>
      <title>在 layouts 中使用 partial 问题</title>
      <description>&lt;p&gt;在项目默认的 layout 文件 application.html.erb 中使用 partial，
&lt;code&gt;&amp;lt;% render "help" %&amp;gt;&lt;/code&gt;
已经在 layouts 文件夹中放了_help.html.erb 文件&lt;/p&gt;

&lt;p&gt;然后调用页面 demo/index
&lt;a href="http://localhost:3000/demo/index" rel="nofollow" target="_blank"&gt;http://localhost:3000/demo/index&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;报错说：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Missing&lt;/span&gt; &lt;span class="n"&gt;partial&lt;/span&gt; &lt;span class="n"&gt;demo&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;help&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;help&lt;/span&gt; &lt;span class="n"&gt;with&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="ss"&gt;:locale&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;:zh&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="ss"&gt;:formats&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;:handlers&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;:builder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:coffee&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="no"&gt;Searched&lt;/span&gt; &lt;span class="ss"&gt;in:
  &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="s2"&gt;"/home/vagrant/vdata/rnes/app/views"&lt;/span&gt;
  &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="s2"&gt;"/home/vagrant/.rvm/gems/ruby-2.0.0-p0/gems/twitter-bootstrap-rails-2.2.6/app/views"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;问题解决倒不难，改成&lt;code&gt;&amp;lt;% render "layouts/help" %&amp;gt;&lt;/code&gt;就可以了。
但是我想问一下如果仅指明 partial 文件名，在 layouts 中调用 partial 的路径调用顺序是怎样的？看报错信息似乎是从当前渲染页面的路径中找而不是在 layouts 文件夹中找，如果 miss 了似乎还会找到&lt;code&gt;application/help&lt;/code&gt;里去（经过测试确实是找到 application/help 里去了）。这个文件夹有点诡异啊，为什么不是默认的 layouts 文件夹呢？&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Mon, 15 Apr 2013 14:40:46 +0800</pubDate>
      <link>https://ruby-china.org/topics/10215</link>
      <guid>https://ruby-china.org/topics/10215</guid>
    </item>
    <item>
      <title>ruby 2.0 上 bson_ext 总是报告 not loaded</title>
      <description>&lt;p&gt;我用 rvm 升级 ruby 到 2.0，装了 mongo gem，然后安装 bson_ext，但是用的时候总是报告 not loaded。信息如下：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;** Notice: The native BSON extension was not loaded. **

For optimal performance, use of the BSON extension is recommended.

To enable the extension make sure ENV['BSON_EXT_DISABLED'] is not set
and run the following command:

  gem install bson_ext

If you continue to receive this message after installing, make sure that
the bson_ext gem is in your load path.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;原来在 1.9.3 上装了以后没做什么设置就能用了，没报错。有人碰到这个问题吗？&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Fri, 01 Mar 2013 17:01:03 +0800</pubDate>
      <link>https://ruby-china.org/topics/9050</link>
      <guid>https://ruby-china.org/topics/9050</guid>
    </item>
    <item>
      <title>纯吐槽一下微信</title>
      <description>&lt;p&gt;今天看微信更新 4.5 版，提供新接口。想去看看新接口啥样子，结果进了自己的公众账号以后，发现要重新登记用户信息了，填手机号身份证号什么的也就罢了，居然还要提供这个
&lt;img src="//l.ruby-china.com/photo/424bc750adcb8333eddab93cdd0ef751.png" title="" alt=""&gt;
就跟美国电影里嫌犯举个牌子拍照留底一样。
搞个接口开发至于搞的跟警局留案底一样吗...&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Wed, 06 Feb 2013 10:10:37 +0800</pubDate>
      <link>https://ruby-china.org/topics/8620</link>
      <guid>https://ruby-china.org/topics/8620</guid>
    </item>
    <item>
      <title>ruby-china 的会员权限系统是怎么设计的？</title>
      <description>&lt;p&gt;忽然发现自己的个人信息页左上角有一个 wiki 管理员。
&lt;img src="//l.ruby-china.com/photo/668161a42496bbe3ae83e79dbb2b2208.png" title="" alt=""&gt;
我这种一直潜水做伸手党的有点不好意思了...&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Fri, 18 Jan 2013 17:40:42 +0800</pubDate>
      <link>https://ruby-china.org/topics/8174</link>
      <guid>https://ruby-china.org/topics/8174</guid>
    </item>
    <item>
      <title>用 Grape 搭建微信公众平台回复 API 的蛋痛经过</title>
      <description>&lt;p&gt;前两天闲着没事，申请了一个微信公众账号，想自己搭一个回复后台。本来一个很简单的 controller 就可以搞定了，但脑子一热用了 grape（&lt;a href="https://github.com/intridea/grape" rel="nofollow" target="_blank"&gt;https://github.com/intridea/grape&lt;/a&gt;），蛋痛的历程就开始了。&lt;/p&gt;

&lt;p&gt;微信公众平台接口用的是 xml，因此仿照 grape 给的示例直接改动 format 为 xml&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyAPI&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;Grape&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;API&lt;/span&gt;
  &lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="s1"&gt;'v1'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:using&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:path&lt;/span&gt;
  &lt;span class="nb"&gt;format&lt;/span&gt; &lt;span class="ss"&gt;:xml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;但回复报错，后来仔细查看文档，需要增加 content_type 说明&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your API can declare which types to support by using content_type. Response format is determined by the request's extension, an explicit format parameter in the query string, or Accept header.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;加上 content_type 说明后，现在可以接受 xml post 数据了&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyAPI&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;Grape&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;API&lt;/span&gt;
  &lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="s1"&gt;'v1'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:using&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:path&lt;/span&gt;
  &lt;span class="nb"&gt;format&lt;/span&gt; &lt;span class="ss"&gt;:xml&lt;/span&gt;
  &lt;span class="n"&gt;content_type&lt;/span&gt; &lt;span class="ss"&gt;:xml&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"text/xml"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;一开始的时候可以使用 params["xml"]["xxx"] 可以直接获取解析后的 xml post 数据，但是后来不知道是哪个 gem update 了还是怎么回事，传上来的 xml post 数据不能直接映射到 params hash 里面，解析出现了问题。这一点很奇怪，只好抛弃 params 手动解析&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Hash&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_xml&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;以上两条都处理完以后以为可以正常回复了，但是手机上发消息死活还是没有回应。我猜测是不是返回的 xml 格式问题，我采用的是 nokogiri 拼装 xml，会自动带上 xml declaration&amp;lt;? xml version='1.0'?&amp;gt;，原来在做其他平台的 xml api 解析的时候碰到过 xml declaration 影响解析的情况。所以就想方设法在输出中去掉了 xml declaration，但是没效果，仍然发消息没回复。&lt;/p&gt;

&lt;p&gt;google 搜索的结果有说道接口回复不能超过 5 秒，否则有可能视为会话超时（ &lt;a href="http://www.html-js.com/?p=1527" rel="nofollow" target="_blank"&gt;http://www.html-js.com/?p=1527&lt;/a&gt; ），我是采用 nginx+passenger 的 server，在 nginx 初次启动 passenger 的时候确实会比较慢。为了调查是否超时，只能抓包看了。&lt;/p&gt;

&lt;p&gt;由于微信接口测试只能在线上环境进行，没法使用 wireshark，只能采用 tcpdump 抓包分析&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;tcpdump &lt;span class="nt"&gt;-A&lt;/span&gt; &lt;span class="nt"&gt;-s0&lt;/span&gt; host xxx and port 80 &lt;span class="nt"&gt;-w&lt;/span&gt; ~/dump.cap
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;抓包结果是回复还是很及时的，基本不超过 1 秒钟（只是简单的将用户发来的消息回传回去，未作额外处理）。因此应该不是超时的问题。&lt;/p&gt;

&lt;p&gt;似乎走到了绝境了，万般无奈之下只能反复的看抓包结果，无意中发现 grape post 回复的 http status code 不是一般的 200 OK，而是 201 created。会不会是微信平台那边不接受非 200 status code 而拒绝服务？抱着试试看的想法试着加了一行 status 设置&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;desc&lt;/span&gt; &lt;span class="s2"&gt;"reply"&lt;/span&gt;
&lt;span class="n"&gt;post&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Hash&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_xml&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"200"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Nokogiri&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;XML&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;终于，手机端看到回复了，当场泪奔啊...&lt;/p&gt;

&lt;p&gt;事后分析 grape 源码，发现 post 的时候是默认回复 201 的&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;
        &lt;span class="vi"&gt;@status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;
      &lt;span class="k"&gt;else&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="vi"&gt;@status&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vi"&gt;@status&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request_method&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;upcase&lt;/span&gt;
          &lt;span class="k"&gt;when&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt;
            &lt;span class="mi"&gt;201&lt;/span&gt;
          &lt;span class="k"&gt;else&lt;/span&gt;
            &lt;span class="mi"&gt;200&lt;/span&gt;
        &lt;span class="k"&gt;end&lt;/span&gt;
      &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;再查看 W3C 对 http post 的说明（&lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5" rel="nofollow" target="_blank"&gt;http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5&lt;/a&gt;）&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The action performed by the POST method might not result in a resource that can be identified by a URI. In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the response includes an entity that describes the result.

If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity which describes the status of the request and refers to the new resource, and a Location header
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在不创建可以被 URI 定位的资源的时候，应该回复 200 或者 204，在创建了 URI 资源的时候，应该回复 201。&lt;/p&gt;

&lt;p&gt;仔细想想，微信发消息虽然是 post，但是也确实也没有创建资源，因此要求 status code 为 200 也没错。&lt;/p&gt;

&lt;p&gt;可是微信的文档应该说一下啊！！微信公众平台的狗屁文档（&lt;a href="http://mp.weixin.qq.com/cgi-bin/readtemplate?t=wxm-callbackapi-doc&amp;amp;lang=zh_CN" rel="nofollow" target="_blank"&gt;http://mp.weixin.qq.com/cgi-bin/readtemplate?t=wxm-callbackapi-doc&amp;amp;lang=zh_CN&lt;/a&gt;）这些细节提都没提。折腾了我好几天！！&lt;/p&gt;

&lt;p&gt;最后总结一下：&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; 微信的公众平台接口很不完善：

&lt;ol&gt;
&lt;li&gt; 只支持 80 端口，自定义端口还不支持，我实在是无法理解这个有什么技术难度。&lt;/li&gt;
&lt;li&gt; get 方法进行接口校验基本是个摆设，传给一堆参数，还假模假样的设置了一个 token 进行校验，其实我不判断校验直接返回 echostr 也一点事儿都没有。而在真正使用 post 方法传消息的时候却没有给 echostr 进行校验，只传了以下参数
&lt;code&gt;signature=7f82a86b5f4de67df1d0242793a098a13a3fcffa&amp;amp;timestamp=1358324694&amp;amp;nonce=1358209407&lt;/code&gt;
这样在 post 的时候反而没法校验请求是否合法。难以理解为什么要这样设计。&lt;/li&gt;
&lt;li&gt; 文档很不完善，像“5 秒超时”和“http status code = 200”这些细节一点都没提，只有开发人员自己去摸索。真是写给经理看的开发文档。&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt; grape api 框架写的很完善，但是有的地方框的太死了，文档也说得不是很清楚，对 json 说的比较多，而 xml 部分基本没提。对于接口调试没有方便的界面来查错，最后只好抓包调试，代价有点高。&lt;/li&gt;
&lt;li&gt; 杀鸡还是焉用牛刀，对于这么小的需求，其实一个 controller/action 就能搞定的事情折腾出这么多事儿来。太相信框架/组件也不是什么好事...&lt;/li&gt;
&lt;/ol&gt;</description>
      <author>alucardpj</author>
      <pubDate>Wed, 16 Jan 2013 18:48:31 +0800</pubDate>
      <link>https://ruby-china.org/topics/8124</link>
      <guid>https://ruby-china.org/topics/8124</guid>
    </item>
    <item>
      <title>苹果中国官网推出免息分期付款计划</title>
      <description>&lt;p&gt;&lt;a href="http://store.apple.com/cn/browse/finance/installments" rel="nofollow" target="_blank"&gt;http://store.apple.com/cn/browse/finance/installments&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;最新消息，优惠到 2 月 28 号，最多分 12 期免息。&lt;/p&gt;

&lt;p&gt;好像 1 月 25 号有优惠降价活动，大家可以观望一下
&lt;a href="http://store.apple.com/cn/browse/new_year/red_friday?aid=aid-lny13-w-hmp-mn" rel="nofollow" target="_blank"&gt;http://store.apple.com/cn/browse/new_year/red_friday?aid=aid-lny13-w-hmp-mn&lt;/a&gt;&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Mon, 14 Jan 2013 11:31:52 +0800</pubDate>
      <link>https://ruby-china.org/topics/8049</link>
      <guid>https://ruby-china.org/topics/8049</guid>
    </item>
    <item>
      <title>model 记录遍历删除问题</title>
      <description>&lt;p&gt;对某个 model 记录进行遍历，找出其中不符合要求的记录删掉，例如：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nb"&gt;p&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;something&lt;/span&gt;
    &lt;span class="nb"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;destroy&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;问题是这样的写法是否安全？destroy 记录以后会不会对以后的循环遍历产生影响？如果有危险该怎样处理才安全？  &lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Tue, 03 Jul 2012 15:52:27 +0800</pubDate>
      <link>https://ruby-china.org/topics/4107</link>
      <guid>https://ruby-china.org/topics/4107</guid>
    </item>
    <item>
      <title>怎样暂停 resque 任务执行</title>
      <description>&lt;p&gt;用 resque 做异步邮件群发功能，目前没有做发送频率控制，就是简单的把群发任务添加到 resque 队列中执行。但由于群发邮件过多很容易触发垃圾邮件规则，因此 resque 在执行时有可能出现&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;success&lt;/li&gt;
&lt;li&gt;success&lt;/li&gt;
&lt;li&gt;fail&lt;/li&gt;
&lt;li&gt;fail
...&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;当出现邮件发送失败以后后续任务肯定都无法执行，因此有必要中止队列执行。有什么办法能够暂停 resque 执行吗？  &lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Mon, 25 Jun 2012 19:19:31 +0800</pubDate>
      <link>https://ruby-china.org/topics/3984</link>
      <guid>https://ruby-china.org/topics/3984</guid>
    </item>
    <item>
      <title>ubuntu ppa 源装的 nginx 和 passenger 编译安装的 nginx 冲突</title>
      <description>&lt;p&gt;以前一直用 apache+passenger 的，虽然慢但是配置比较方便，现在新折腾 nginx，发现一个问题：
ubuntu 12.04, 
从官方源安装 nginx
&lt;code&gt;sudo apt-get install nginx&lt;/code&gt;
装好后目录是/etc/nginx，然后安装 passenger，
&lt;code&gt;gem install passenger&lt;/code&gt;
再安装 nginx module
·passenger-install-nginx-module·
因为要重新编译 nginx，所以会问我安装位置，默认是/opt/nginx
第一次安装我没管直接使用默认位置，装完以后发现会有两个 nginx，启动时会冲突。
这种情况我是不是在编译的时候设置目录为/etc/nginx 会自动覆盖源安装？
或者干脆不需要 apt-get install nginx，直接让 passenger 安装 nginx 就可以了？&lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Fri, 22 Jun 2012 09:59:42 +0800</pubDate>
      <link>https://ruby-china.org/topics/3936</link>
      <guid>https://ruby-china.org/topics/3936</guid>
    </item>
    <item>
      <title>Linode 25 万美元回馈</title>
      <description>&lt;p&gt;&lt;a href="http://blog.linode.com/2012/06/16/linode-birthday-giveaway/" rel="nofollow" target="_blank"&gt;http://blog.linode.com/2012/06/16/linode-birthday-giveaway/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;新注册用户赠送 100 美元，老用户新增节点可享受三个月免费优惠。  &lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Mon, 18 Jun 2012 14:35:30 +0800</pubDate>
      <link>https://ruby-china.org/topics/3871</link>
      <guid>https://ruby-china.org/topics/3871</guid>
    </item>
    <item>
      <title>carrierwave 上传文件处理问题</title>
      <description>&lt;p&gt;项目有这样的需求：上传一个 excel 文件，读取文件内容导入到数据库中去
我打算采用 carrierwave 来做上传功能，但查看了一些使用范例，一般都是直接绑定到 model 的字段，然后在表单中直接显示这个字段对应的上传控件。
但我这个需求其实上传的文件并不需要把文件名记录到 model/数据库中，只需要上传以后读取文件数据，然后文件就可以删除了。这种情况我该如何处理上传页面表单？
纯新手问。  &lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Thu, 14 Jun 2012 18:22:20 +0800</pubDate>
      <link>https://ruby-china.org/topics/3813</link>
      <guid>https://ruby-china.org/topics/3813</guid>
    </item>
    <item>
      <title>更新 rvm 的时候碰到的问题</title>
      <description>&lt;p&gt;ubuntu 11.10 系统，刚才更新 rvm 碰到这个问题：&lt;/p&gt;

&lt;p&gt;rvm get stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   185  100   185    0     0    107      0  0:00:01  0:00:01 --:--:--  1057
100  8798  100  8798    0     0   2582      0  0:00:03  0:00:03 --:--:--  8102
BASH 3.2.48 required (you have 4.2.10(1)-release)
Could not update RVM, get some help at #rvm IRC channel at freenode servers.&lt;/p&gt;

&lt;p&gt;怎么 rvm 开始要求 bash 版本了？而且还是低版本的 bash？这怎么整？  &lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Tue, 24 Apr 2012 00:04:46 +0800</pubDate>
      <link>https://ruby-china.org/topics/2846</link>
      <guid>https://ruby-china.org/topics/2846</guid>
    </item>
    <item>
      <title>如何套用 erb 模板生成 html 页面并写入文件？</title>
      <description>&lt;p&gt;我有一个需求，要抓取另一个应用接口提供的 xml 数据，然后组装成 html 页面打包做成离线资源包，现在需要将 xml 数据解析后套用预置的 html 模板生成 html 页面然后写到文件里去保存，该如何操作？使用 render？平时只是用 render 渲染页面输出而不是保存到文件。  &lt;/p&gt;</description>
      <author>alucardpj</author>
      <pubDate>Sat, 31 Mar 2012 11:37:53 +0800</pubDate>
      <link>https://ruby-china.org/topics/2296</link>
      <guid>https://ruby-china.org/topics/2296</guid>
    </item>
  </channel>
</rss>
