<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>VincentJiang (VincentJiang)</title>
    <link>https://ruby-china.org/VincentJiang</link>
    <description>VincentJiang</description>
    <language>en-us</language>
    <item>
      <title>Turbolinks 遇上 多说</title>
      <description>&lt;p&gt;这两天在为自己的博客&lt;a href="http://vrails.com/" rel="nofollow" target="_blank" title=""&gt;http://vrails.com&lt;/a&gt;的文章页面中添加评论模块，选用了&lt;a href="http://duoshuo.com/" rel="nofollow" target="_blank" title=""&gt;多说&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;博客使用了 turbolinks，而多说的评论模块在页面中时有时无，这明显是本人对 turbolinks 理解不够好的原因&lt;/p&gt;

&lt;p&gt;以下是多说的代码：&lt;/p&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;ds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;script&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text/javascript&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;protocol&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;//static.duoshuo.com/embed.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;charset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;UTF-8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementsByTagName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;head&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementsByTagName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;body&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;请问我应该如何修改代码，才能让评论模块保持显示？&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Tue, 25 Aug 2015 22:42:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/27080</link>
      <guid>https://ruby-china.org/topics/27080</guid>
    </item>
    <item>
      <title>[已解决] 部署服务器后报 ActionView::Template::Error (incompatible character encodings: ASCII-8BIT and UTF-8)</title>
      <description>&lt;p&gt;在本地好好的，但部署服务器后就报：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I, [2015-08-20T05:34:47.927159 #4105]  INFO -- : Started GET "/about" for 218.17.158.154 at 2015-08-20 05:34:47 +0000
I, [2015-08-20T05:34:47.928334 #4105]  INFO -- : Processing by HomeController#about as HTML
I, [2015-08-20T05:34:47.929142 #4105]  INFO -- :   Rendered home/about.html.slim within layouts/application (0.0ms)
I, [2015-08-20T05:34:47.931840 #4105]  INFO -- :   Rendered share/_header.html.slim (1.7ms)
I, [2015-08-20T05:34:47.933189 #4105]  INFO -- : Completed 500 Internal Server Error in 5ms (ActiveRecord: 0.0ms)
F, [2015-08-20T05:34:47.934438 #4105] FATAL -- :
ActionView::Template::Error (incompatible character encodings: ASCII-8BIT and UTF-8):
    19:       = render 'share/header'
    20:       .vcontent
    21:         = flash_messages(:close, :fade)
    22:         = yield
    23:       = render 'share/footer'
    24:
    25:       a.to-top
  app/views/layouts/application.html.slim:22:in `_app_views_layouts_application_html_slim___2881078729979780413_26378660'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;服务器是&lt;code&gt;Ubuntu 14.04 LTS&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;请问有人有遇到过这种情况吗？&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Thu, 20 Aug 2015 13:42:59 +0800</pubDate>
      <link>https://ruby-china.org/topics/26997</link>
      <guid>https://ruby-china.org/topics/26997</guid>
    </item>
    <item>
      <title>after_save 不能使用 previous_changes</title>
      <description>&lt;p&gt;项目中希望 Model &lt;code&gt;A&lt;/code&gt;某个字段（例如为 attr）保存成功后 touch 一下相关联的 Mobel &lt;code&gt;B&lt;/code&gt;，所以尝试在 Model &lt;code&gt;A&lt;/code&gt;中使用&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;after_save&lt;/span&gt; &lt;span class="ss"&gt;:touch_method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;if: :attr_is_changed?&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;touch_method&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;def&lt;/span&gt; &lt;span class="nf"&gt;attr_is_changed?&lt;/span&gt;
  &lt;span class="n"&gt;previous_changes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;include?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:attr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;查看网上一些资料发现，after_save 后，previous_changes 就会被置空了，所以&lt;code&gt;attr_is_changed?&lt;/code&gt;一直都是返回 false 的。&lt;/p&gt;

&lt;p&gt;请问大家有什么方法可以解决这个问题？&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Wed, 15 Apr 2015 11:55:46 +0800</pubDate>
      <link>https://ruby-china.org/topics/25151</link>
      <guid>https://ruby-china.org/topics/25151</guid>
    </item>
    <item>
      <title>Markdown 中为图片添加 class</title>
      <description>&lt;p&gt;最近在用 Macdown 这个软件写 markdown，在一篇文章中可能会引入很多图片，但会分几类图片，每一类图片都需要定义一个样式，所以需求就来了，如何在 markdown 中为图片定义类？&lt;/p&gt;

&lt;p&gt;我试过&lt;/p&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;![&lt;/span&gt;&lt;span class="nv"&gt;img-text&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;img-path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;{.class}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;但不生效。&lt;/p&gt;

&lt;p&gt;还有别的方法不？还是 markdown 不支持定义图片的类？&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Tue, 24 Mar 2015 10:40:14 +0800</pubDate>
      <link>https://ruby-china.org/topics/24806</link>
      <guid>https://ruby-china.org/topics/24806</guid>
    </item>
    <item>
      <title>vim 退出后 terminal 出现错行</title>
      <description>&lt;p&gt;如题，请问大家有没有遇到过这种情况？是什么问题？
截图如下：&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2015/6f17d6ad7be1a13e9826788b94896225.jpg" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Mon, 02 Feb 2015 22:18:58 +0800</pubDate>
      <link>https://ruby-china.org/topics/24078</link>
      <guid>https://ruby-china.org/topics/24078</guid>
    </item>
    <item>
      <title>如何使用 HHKB 令 Mac 锁屏</title>
      <description>&lt;p&gt;刚入手了 HHKB Pro Type-S，但不知道如何使用快捷键令 Mac 锁屏，请问有无 Rubyer 知道？
现时我的档位设置成 010001。
谢谢！！！&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Fri, 05 Dec 2014 20:33:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/23053</link>
      <guid>https://ruby-china.org/topics/23053</guid>
    </item>
    <item>
      <title>SublimeCodeIntel 配置</title>
      <description>&lt;p&gt;看了 SublimeCodeIntel(&lt;a href="https://github.com/SublimeCodeIntel/SublimeCodeIntel" rel="nofollow" target="_blank"&gt;https://github.com/SublimeCodeIntel/SublimeCodeIntel&lt;/a&gt;) 的配置介绍，配置了好久，一直不成功：&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2014/fb5bed2badd36db55f223dc6d98f3719.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;请问哪位配置成功过吗？介绍一下，谢谢！&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Fri, 07 Nov 2014 19:55:31 +0800</pubDate>
      <link>https://ruby-china.org/topics/22554</link>
      <guid>https://ruby-china.org/topics/22554</guid>
    </item>
    <item>
      <title>国内哪里有英文原版的 ruby 书卖？</title>
      <description>&lt;p&gt;如题，我想买《programming ruby》，《Agile Web Development with Rails 4》之类的最新版纸质书，因为拿在手上，看得才带感。&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Wed, 27 Aug 2014 15:22:30 +0800</pubDate>
      <link>https://ruby-china.org/topics/21251</link>
      <guid>https://ruby-china.org/topics/21251</guid>
    </item>
    <item>
      <title>Rails 4.0.9 和 4.1.5 发布，请尽快升级</title>
      <description>&lt;p&gt;Rails 今天发布了两个小更新版本，分别是 4.0.9 和 4.1.5，这两个版本都修复了一个安全问题：&lt;a href="https://groups.google.com/d/msg/rubyonrails-security/M4chq5Sb540/CC1Fh0Y_NWwJ" rel="nofollow" target="_blank" title=""&gt;CVE-2014-3514&lt;/a&gt;  建议尽快升级。&lt;/p&gt;

&lt;p&gt;Ruby on Rails 是一个用于开发数据库驱动的网络应用程序的完整框架。Rails 基于 MVC（模型 - 视图 - 控制器）设计模式。从视图中的 Ajax 应用，到控制器中的访问请求和反馈，到封装数据库的模型，Rails 为你提供一个纯 Ruby 的开发环境。发布网站时，你只需要一个数据库和一个网络服务器即可。&lt;/p&gt;

&lt;p&gt;Link: &lt;a href="http://www.oschina.net/news/54550/rails_4_0_9_and_4_1_5_have_been_released" rel="nofollow" target="_blank"&gt;http://www.oschina.net/news/54550/rails_4_0_9_and_4_1_5_have_been_released&lt;/a&gt;&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Tue, 19 Aug 2014 08:49:58 +0800</pubDate>
      <link>https://ruby-china.org/topics/21107</link>
      <guid>https://ruby-china.org/topics/21107</guid>
    </item>
    <item>
      <title>nginx + unicorn + mina</title>
      <description>&lt;p&gt;这几天一直在折腾部署的方法，现时的组合是&lt;code&gt;nginx + unicorn + mina&lt;/code&gt;，特点是&lt;code&gt;热部署&lt;/code&gt;，具体的方法如我的 Gist 中代码所示：
&lt;a href="https://gist.github.com/vincentjiang/11280862" rel="nofollow" target="_blank"&gt;https://gist.github.com/vincentjiang/11280862&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;已经亲自测试过几次，应该没有问题吧，如果大家发现有问题，请告诉我，谢谢啦！&lt;/p&gt;

&lt;p&gt;最后希望对大家有帮助。&lt;/p&gt;

&lt;p&gt;参考来自：&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/articles/how-to-deploy-rails-apps-using-unicorn-and-nginx-on-centos-6-5" rel="nofollow" target="_blank"&gt;https://www.digitalocean.com/community/articles/how-to-deploy-rails-apps-using-unicorn-and-nginx-on-centos-6-5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/windy/wblog/blob/master/config/deploy.rb" rel="nofollow" target="_blank"&gt;https://github.com/windy/wblog/blob/master/config/deploy.rb&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Fri, 25 Apr 2014 16:47:55 +0800</pubDate>
      <link>https://ruby-china.org/topics/18851</link>
      <guid>https://ruby-china.org/topics/18851</guid>
    </item>
    <item>
      <title>nginx + puma + mina</title>
      <description>&lt;p&gt;听说 nginx 比 apache 效率高，puma 比较省资源，mina 部署比较自动化，有无 rubyist 可以给我介绍一下三者在一起的教程？
谢谢！&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Mon, 21 Apr 2014 23:37:57 +0800</pubDate>
      <link>https://ruby-china.org/topics/18756</link>
      <guid>https://ruby-china.org/topics/18756</guid>
    </item>
    <item>
      <title>RubyTuesday</title>
      <description>&lt;p&gt;周六去了趟 HK，在沙田广场看到 RubyTuesday，不知道这是不是传说中咱 Ruby 圈里的 RubyTuesday？
&lt;img src="//l.ruby-china.com/photo/2014/9d397ece19b147e8ebb8d617e5bacc4b.jpg" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Mon, 24 Mar 2014 10:32:59 +0800</pubDate>
      <link>https://ruby-china.org/topics/18124</link>
      <guid>https://ruby-china.org/topics/18124</guid>
    </item>
    <item>
      <title>semantic-ui 的 javascript 不工作</title>
      <description>&lt;p&gt;今天在配置 semantic-ui-sass with Rails，链接如下：
&lt;a href="https://github.com/doabit/semantic-ui-sass#semantic-ui-sass-with-rails" rel="nofollow" target="_blank"&gt;https://github.com/doabit/semantic-ui-sass#semantic-ui-sass-with-rails&lt;/a&gt;
按照方法配置网站的 CSS 可以工作，但 Javascript 就不工作，请问有无高手可以为我解答？
以下是我 application.js 配置后的内容：&lt;/p&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// This is a manifest file that'll be compiled into application.js, which will include all the files&lt;/span&gt;
&lt;span class="c1"&gt;// listed below.&lt;/span&gt;
&lt;span class="c1"&gt;//&lt;/span&gt;
&lt;span class="c1"&gt;// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,&lt;/span&gt;
&lt;span class="c1"&gt;// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.&lt;/span&gt;
&lt;span class="c1"&gt;//&lt;/span&gt;
&lt;span class="c1"&gt;// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the&lt;/span&gt;
&lt;span class="c1"&gt;// compiled file.&lt;/span&gt;
&lt;span class="c1"&gt;//&lt;/span&gt;
&lt;span class="c1"&gt;// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details&lt;/span&gt;
&lt;span class="c1"&gt;// about supported directives.&lt;/span&gt;
&lt;span class="c1"&gt;//&lt;/span&gt;
&lt;span class="c1"&gt;//= require jquery&lt;/span&gt;
&lt;span class="c1"&gt;//= require jquery_ujs&lt;/span&gt;
&lt;span class="c1"&gt;//= require turbolinks&lt;/span&gt;
&lt;span class="c1"&gt;// Loads all Semantic javascripts&lt;/span&gt;
&lt;span class="c1"&gt;//= require semantic-ui&lt;/span&gt;
&lt;span class="c1"&gt;//= require_tree .&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;谢谢！&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Fri, 21 Mar 2014 18:43:21 +0800</pubDate>
      <link>https://ruby-china.org/topics/18076</link>
      <guid>https://ruby-china.org/topics/18076</guid>
    </item>
    <item>
      <title>关于 UIkit tooltip 的使用</title>
      <description>&lt;p&gt;背景：我的项目中使用 UIkit（&lt;a href="http://getuikit.com/" rel="nofollow" target="_blank"&gt;http://getuikit.com/&lt;/a&gt;）
我在使用 tooltip 的时候，刷新网页可以显示 tooltip，但点击网页任何一个链接后，tooltip 就失效了，请问是什么原因？&lt;/p&gt;

&lt;p&gt;顺便&lt;a href="/nightire" class="user-mention" title="@nightire"&gt;&lt;i&gt;@&lt;/i&gt;nightire&lt;/a&gt;，看了你关于 UIkit（&lt;a href="http://ruby-china.org/topics/14248" rel="nofollow" target="_blank"&gt;http://ruby-china.org/topics/14248&lt;/a&gt;）的介绍，如果可以的话，请帮忙看一下是什么问题，谢谢！&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Tue, 04 Mar 2014 10:28:48 +0800</pubDate>
      <link>https://ruby-china.org/topics/17646</link>
      <guid>https://ruby-china.org/topics/17646</guid>
    </item>
    <item>
      <title>ruby round down 三位小数</title>
      <description>&lt;p&gt;如题，请问如何在 ruby 中保留三位小数，但不四舍五入？
例如&lt;code&gt;1.2345&lt;/code&gt;保留三位小数为：&lt;code&gt;1.234&lt;/code&gt;
谢谢！&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Sun, 19 Jan 2014 17:34:00 +0800</pubDate>
      <link>https://ruby-china.org/topics/16867</link>
      <guid>https://ruby-china.org/topics/16867</guid>
    </item>
    <item>
      <title>Prawn 中文显示问题 (已解决)</title>
      <description>&lt;p&gt;我在代码中写&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Prawn&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vi"&gt;@pdf_file&lt;/span&gt;&lt;span class="p"&gt;)&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;pdf&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
      &lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"这是一个PDF测试文件123"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;生成 PDF 后，显示不到中文，只显示英文和数字，如下图所示：
&lt;img src="//l.ruby-china.com/photo/2014/427e4973c3b25663c0a6c15024bb714d.jpg" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;上网搜了一下，好像我是缺少 TTF 中文字体。&lt;/p&gt;
&lt;h2 id="1. 请问有哪位rubyer可以分享中文字体？"&gt;1. 请问有哪位 rubyer 可以分享中文字体？&lt;/h2&gt;&lt;h2 id="2. 告诉我MAC系统下Prawn字体的安装路径是什么？"&gt;2. 告诉我 MAC 系统下 Prawn 字体的安装路径是什么？&lt;/h2&gt;
&lt;p&gt;谢谢！&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Mon, 13 Jan 2014 16:30:53 +0800</pubDate>
      <link>https://ruby-china.org/topics/16763</link>
      <guid>https://ruby-china.org/topics/16763</guid>
    </item>
    <item>
      <title>wrong number of arguments (0 for 1)</title>
      <description>&lt;p&gt;我在 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="nf"&gt;mkpdf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;certificate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="c1"&gt;# mke the pdf folder&lt;/span&gt;
  &lt;span class="k"&gt;unless&lt;/span&gt; &lt;span class="no"&gt;Dir&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exist?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"pdf"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="no"&gt;Dir&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mkdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"pdf"&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;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在 routes.rb 中有：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;get&lt;/span&gt; &lt;span class="s1"&gt;'mkpdf'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"certificates#mkpdf"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在页面中有：&lt;/p&gt;
&lt;pre class="highlight erb"&gt;&lt;code&gt;mkpdf_path(certificate)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;当我点击页面的 mkpdf_path 相应的连接的时候，发生了&lt;code&gt;wrong number of arguments (0 for 1)&lt;/code&gt;的报错，请问我代码哪里错了？&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Sat, 11 Jan 2014 16:46:44 +0800</pubDate>
      <link>https://ruby-china.org/topics/16735</link>
      <guid>https://ruby-china.org/topics/16735</guid>
    </item>
    <item>
      <title>号外！CentOS 宣布加入红帽公司！</title>
      <description>&lt;p&gt;来自 CentOS 邮件列表的消息:
CentOS 项目已加入红帽公司，作为红帽公司开源和标准团队 ( &lt;a href="http://community.redhat.com/" rel="nofollow" target="_blank"&gt;http://community.redhat.com/&lt;/a&gt; ) 的一部分，培养快速创新平台之外的下一代新兴技术。将于 Fedora 和 RHEL 生态系统一起工作，我们希望通过新的平台进一步扩大社区服务。&lt;/p&gt;

&lt;p&gt;我们已经发布了全新的 CentOS 网站：&lt;a href="http://www.centos.org/" rel="nofollow" target="_blank"&gt;http://www.centos.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;新计划将由新的 CentOS 管理董事会管理。最初的董事会由现有 CentOS 的核心团队成员包括：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;- Ralph Angenent&lt;/li&gt;
&lt;li&gt;- Tru Hyunh&lt;/li&gt;
&lt;li&gt;- Johnny Hughes JR&lt;/li&gt;
&lt;li&gt;- Jim Perrin&lt;/li&gt;
&lt;li&gt;- Karanbir Singh&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;此外还包括新成员：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;- Fabian Arrotin, 来自社区董事会提名&lt;/li&gt;
&lt;li&gt;- Carl Trieloff, Karsten Wade, and Mike McLean 红帽提名&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;董事会工作方针：公开、开放和包容。&lt;a href="http://www.centos.org/about/governance/" rel="nofollow" target="_blank"&gt;http://www.centos.org/about/governance/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CentOS 加入红帽后不变的是：&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CentOS 继续不收费&lt;/li&gt;
&lt;li&gt;保持赞助内容驱动的网络中心不变&lt;/li&gt;
&lt;li&gt;Bug、Issue 和紧急事件处理策略不变&lt;/li&gt;
&lt;li&gt;Red Hat Enterprise Linux 和 CentOS 防火墙也依然存在&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;变化的是：&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;我们是为红帽工作，不是为 RHEL&lt;/li&gt;
&lt;li&gt;红帽提供构建系统和初始内容分发资源的赞助&lt;/li&gt;
&lt;li&gt;一些开发的资源包括源码的获取将更加容易&lt;/li&gt;
&lt;li&gt;避免了原来和红帽上一些法律的问题&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;此新闻在 CentOS 和红帽官网上都已发布：&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lists.centos.org/pipermail/centos-announce/2014-January/020100.html" rel="nofollow" target="_blank"&gt;http://lists.centos.org/pipermail/centos-announce/2014-January/020100.html&lt;/a&gt;
&lt;a href="http://www.redhat.com/about/news/press-archive/2014/1/red-hat-and-centos-join-forces" rel="nofollow" target="_blank"&gt;http://www.redhat.com/about/news/press-archive/2014/1/red-hat-and-centos-join-forces&lt;/a&gt;&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Wed, 08 Jan 2014 10:10:35 +0800</pubDate>
      <link>https://ruby-china.org/topics/16686</link>
      <guid>https://ruby-china.org/topics/16686</guid>
    </item>
    <item>
      <title>传值方法</title>
      <description>&lt;p&gt;请问大家，有一个 date.rb 的 model，我的 new 页面上有个 input 输入了 date0，而我想在后台中把 date0 传值给 date1 和 date2，然后再保存在数据库中，date.rb 里面的代码如何写？
我记得就是好简单的总是，但就是想不出，哎～～～
谢谢各位啦！&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Thu, 12 Dec 2013 14:47:39 +0800</pubDate>
      <link>https://ruby-china.org/topics/16161</link>
      <guid>https://ruby-china.org/topics/16161</guid>
    </item>
    <item>
      <title>mixture.io 的 CSS 框架</title>
      <description>&lt;p&gt;如题，今天在 &lt;a href="http://mixture.io" rel="nofollow" target="_blank"&gt;http://mixture.io&lt;/a&gt; 上看到的 button 好漂亮呢，请问有没人知道是什么 CSS 框架？&lt;/p&gt;</description>
      <author>VincentJiang</author>
      <pubDate>Sat, 30 Nov 2013 13:42:30 +0800</pubDate>
      <link>https://ruby-china.org/topics/15900</link>
      <guid>https://ruby-china.org/topics/15900</guid>
    </item>
  </channel>
</rss>
