<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>ShayneChow (ShayneChow)</title>
    <link>https://ruby-china.org/ShayneChow</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>OS X 下 simple-captcha 验证码无法出来</title>
      <description>&lt;p&gt;维护老项目出现的验证码失效问题
问题如图：
&lt;img src="https://l.ruby-china.com/photo/2014/6949d8861b634abe0de25016e764eb33.png" title="" alt="验证码失效"&gt;&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;#SimpleCaptchasController&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;remote_valid&lt;/span&gt;
    &lt;span class="n"&gt;result&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;params&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:value&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
               &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;SimpleCaptcha&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Utils&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;simple_captcha_value&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:value&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
               &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:value&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;' '&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;else&lt;/span&gt;
               &lt;span class="kp"&gt;false&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;json: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="ss"&gt;pass: &lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="ss"&gt;layout: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;线上可以使用，本地项目失效，很久没有碰 rails，到哪都是坑，求解救！&lt;/p&gt;</description>
      <author>ShayneChow</author>
      <pubDate>Sat, 11 Oct 2014 11:51:07 +0800</pubDate>
      <link>https://ruby-china.org/topics/21983</link>
      <guid>https://ruby-china.org/topics/21983</guid>
    </item>
    <item>
      <title>Mac 下 bundle 安装 ‘charlock_holmes’ 各种失败，求指导</title>
      <description>&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#系统环境：
OS X 10.9.5
ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-darwin13.1.0]
Rails 4.0.4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;BTW：服务器环境可以正常安装（Ubuntu）&lt;/p&gt;

&lt;p&gt;Google 了一下午，愣装不上啊，愁！
有说是 &lt;code&gt;bundle&lt;/code&gt; 的 bug 的，有说是 &lt;code&gt;charlock_holmes&lt;/code&gt; 在 64 位系统的 bug，有说需要依赖 &lt;code&gt;icu4c&lt;/code&gt; 的……&lt;/p&gt;

&lt;p&gt;记得之前也有这个问题，不知道怎么处理了一下好了一阵子，现在又出现。&lt;/p&gt;

&lt;p&gt;&lt;code&gt;icu4c-53.1 already installed&lt;/code&gt; 由 brew 管理&lt;/p&gt;

&lt;p&gt;Gemfile 里是&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# 读取 csv/excel&lt;/span&gt;
&lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s1"&gt;'roo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;git: &lt;/span&gt;&lt;span class="s1"&gt;'https://github.com/Empact/roo.git'&lt;/span&gt;

&lt;span class="c1"&gt;#gem 'charlock_holmes', git: 'https://github.com/brianmario/charlock_holmes.git'&lt;/span&gt;
&lt;span class="c1"&gt;#gem 'charlock_holmes', '~&amp;gt; 0.6.9.4'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;大家看到的，各个版本均尝试了
结果如下：&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb &lt;span class="nt"&gt;--with-icu-dir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/local/opt/icu4c
checking &lt;span class="k"&gt;for &lt;/span&gt;main&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;-licui18n&lt;/span&gt;... &lt;span class="k"&gt;***&lt;/span&gt; extconf.rb failed &lt;span class="k"&gt;***&lt;/span&gt;
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file &lt;span class="k"&gt;for &lt;/span&gt;more details.  You may
need configuration options.

Provided configuration options:
    &lt;span class="nt"&gt;--with-opt-dir&lt;/span&gt;
    &lt;span class="nt"&gt;--with-opt-include&lt;/span&gt;
    &lt;span class="nt"&gt;--without-opt-include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;opt&lt;/span&gt;&lt;span class="p"&gt;-dir&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/include
    &lt;span class="nt"&gt;--with-opt-lib&lt;/span&gt;
    &lt;span class="nt"&gt;--without-opt-lib&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;opt&lt;/span&gt;&lt;span class="p"&gt;-dir&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/lib
    &lt;span class="nt"&gt;--with-make-prog&lt;/span&gt;
    &lt;span class="nt"&gt;--without-make-prog&lt;/span&gt;
    &lt;span class="nt"&gt;--srcdir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
    &lt;span class="nt"&gt;--curdir&lt;/span&gt;
    &lt;span class="nt"&gt;--ruby&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/bin/ruby
    &lt;span class="nt"&gt;--with-icu-dir&lt;/span&gt;
    &lt;span class="nt"&gt;--with-icu-include&lt;/span&gt;
    &lt;span class="nt"&gt;--without-icu-include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;icu&lt;/span&gt;&lt;span class="p"&gt;-dir&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/include
    &lt;span class="nt"&gt;--with-icu-lib&lt;/span&gt;
    &lt;span class="nt"&gt;--without-icu-lib&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;icu&lt;/span&gt;&lt;span class="p"&gt;-dir&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/
    &lt;span class="nt"&gt;--with-icui18nlib&lt;/span&gt;
    &lt;span class="nt"&gt;--without-icui18nlib&lt;/span&gt;
/Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:434:in &lt;span class="sb"&gt;`&lt;/span&gt;try_do&lt;span class="s1"&gt;': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:534:in &lt;span class="sb"&gt;`&lt;/span&gt;try_link&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:720:in `try_func'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:950:in &lt;span class="sb"&gt;`&lt;/span&gt;block &lt;span class="k"&gt;in &lt;/span&gt;have_library&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:340:in &lt;span class="sb"&gt;`&lt;/span&gt;block &lt;span class="o"&gt;(&lt;/span&gt;2 levels&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;in &lt;/span&gt;postpone&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:310:in `open'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:340:in &lt;span class="sb"&gt;`&lt;/span&gt;block &lt;span class="k"&gt;in &lt;/span&gt;postpone&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:310:in `open'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:336:in &lt;span class="sb"&gt;`&lt;/span&gt;postpone&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/mkmf.rb:945:in &lt;span class="sb"&gt;`&lt;/span&gt;have_library&lt;span class="s1"&gt;'
    from extconf.rb:27:in `&amp;lt;main&amp;gt;'&lt;/span&gt;

extconf failed, &lt;span class="nb"&gt;exit &lt;/span&gt;code 1

Gem files will remain installed &lt;span class="k"&gt;in&lt;/span&gt; /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451@global/gems/charlock_holmes-0.6.9.4 &lt;span class="k"&gt;for &lt;/span&gt;inspection.
Results logged to /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451@global/extensions/x86_64-darwin-13/2.0.0/charlock_holmes-0.6.9.4/gem_make.out
An error occurred &lt;span class="k"&gt;while &lt;/span&gt;installing charlock_holmes &lt;span class="o"&gt;(&lt;/span&gt;0.6.9.4&lt;span class="o"&gt;)&lt;/span&gt;, and Bundler cannot &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Make sure that &lt;span class="sb"&gt;`&lt;/span&gt;gem &lt;span class="nb"&gt;install &lt;/span&gt;charlock_holmes &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s1"&gt;'0.6.9.4'&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt; succeeds before bundling.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;跪求解决方案&lt;/strong&gt;&lt;/p&gt;</description>
      <author>ShayneChow</author>
      <pubDate>Fri, 10 Oct 2014 15:59:35 +0800</pubDate>
      <link>https://ruby-china.org/topics/21963</link>
      <guid>https://ruby-china.org/topics/21963</guid>
    </item>
    <item>
      <title>关于 gem 'acts-as-taggable-on' 的一个小坑</title>
      <description>&lt;p&gt;今天被&lt;code&gt;'acts-as-taggable-on'&lt;/code&gt;这个 gem 的一个小坑狠狠的坑了一把。&lt;/p&gt;

&lt;p&gt;昨天更新了一个老项目，加了几个 gem，更新了 bundle
今天下午客户来抱怨有个功能报错
&lt;img src="https://l.ruby-china.com/photo/2014/2a4a01f28863c734e758867280ea137f.jpg" title="" alt=""&gt;
一开始感到很奇怪，这与我昨天修改的毫无关系，怎么之前好好地就挂了呢？
于是各种搜索，各种查看数据库，依然没有答案
后来仔细查看了前后两版的代码，跟这个功能相关的什么都变化，问题出在哪里？
调试发现是创建 tag 时会报错
发现跟 tag 有关的变化就只有&lt;code&gt;gemfile.lock&lt;/code&gt;
&lt;img src="https://l.ruby-china.com/photo/2014/ca8f33b3980d774eda097ea373c368eb.png" title="" alt=""&gt;
我想这不大可能有问题啊，一个 update 而已，不过我还是抱着试试看的心态，改回了原来的旧版
结果居然成功了！原来是这个 gem 新旧版本不完全兼容。&lt;/p&gt;

&lt;p&gt;不知道这样算不算是个坑，反正把我狠狠坑了一下午，差点开始怀疑人生了。
分享一下苦逼的经验&lt;/p&gt;

&lt;p&gt;BTW：
使用&lt;code&gt;acts-as-taggable-on&lt;/code&gt;时最好指定版本 (尤其是在你使用较早版本时候)&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# tag&lt;/span&gt;
&lt;span class="c1"&gt;# gem 'acts-as-taggable-on'  #这样会再bundle时更新到最新版，可能会引起意想不到问题&lt;/span&gt;
&lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s1"&gt;'acts-as-taggable-on'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'~&amp;gt; 2.4.1'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>ShayneChow</author>
      <pubDate>Tue, 01 Jul 2014 22:05:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/20262</link>
      <guid>https://ruby-china.org/topics/20262</guid>
    </item>
    <item>
      <title>gem 'simple_captcha' 无法正常安装，使用 easy_captcha 实现</title>
      <description>&lt;p&gt;被这个问题折腾了很久，给回复表单加验证码功能，使用 simple_captcha。&lt;/p&gt;

&lt;p&gt;按照&lt;a href="https://github.com/galetahub/simple-captcha" rel="nofollow" target="_blank"&gt;https://github.com/galetahub/simple-captcha&lt;/a&gt;说明来操作的&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s1"&gt;'simple_captcha'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:git&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'git://github.com/galetahub/simple-captcha.git'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;bundle update
.......
Using simple_captcha &lt;span class="o"&gt;(&lt;/span&gt;0.1.6&lt;span class="o"&gt;)&lt;/span&gt; from git://github.com/galetahub/simple-captcha.git &lt;span class="o"&gt;(&lt;/span&gt;at master&lt;span class="o"&gt;)&lt;/span&gt;
Using sorcery &lt;span class="o"&gt;(&lt;/span&gt;0.8.5&lt;span class="o"&gt;)&lt;/span&gt;
Using turbolinks &lt;span class="o"&gt;(&lt;/span&gt;2.2.1&lt;span class="o"&gt;)&lt;/span&gt;
Using uglifier &lt;span class="o"&gt;(&lt;/span&gt;2.5.0&lt;span class="o"&gt;)&lt;/span&gt;
Your bundle is updated!
&lt;/code&gt;&lt;/pre&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;rails g simple_captcha

rake db:migrate
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;感觉到这里都很正常，启动服务（使用的 RubyMine），报错：&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/source/git.rb:179:in &lt;span class="sb"&gt;`&lt;/span&gt;rescue &lt;span class="k"&gt;in &lt;/span&gt;load_spec_files&lt;span class="s1"&gt;': git://github.com/galetahub/simple-captcha.git (at master) is not yet checked out. Run `bundle install` first. (Bundler::GitError)
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/source/git.rb:176:in `load_spec_files'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/source/path.rb:86:in &lt;span class="sb"&gt;`&lt;/span&gt;local_specs&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/source/git.rb:150:in `specs'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/lazy_specification.rb:53:in &lt;span class="sb"&gt;`&lt;/span&gt;__materialize__&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/spec_set.rb:88:in `block in materialize'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in &lt;span class="sb"&gt;`&lt;/span&gt;map!&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `materialize'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/definition.rb:133:in &lt;span class="sb"&gt;`&lt;/span&gt;specs&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/definition.rb:178:in `specs_for'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/definition.rb:167:in &lt;span class="sb"&gt;`&lt;/span&gt;requested_specs&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/environment.rb:18:in `requested_specs'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/runtime.rb:13:in &lt;span class="sb"&gt;`&lt;/span&gt;setup&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler.rb:119:in `setup'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.5.3/lib/bundler/setup.rb:17:in &lt;span class="sb"&gt;`&lt;/span&gt;&amp;lt;top &lt;span class="o"&gt;(&lt;/span&gt;required&lt;span class="o"&gt;)&amp;gt;&lt;/span&gt;&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require'&lt;/span&gt;
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in &lt;span class="sb"&gt;`&lt;/span&gt;rescue &lt;span class="k"&gt;in &lt;/span&gt;require&lt;span class="s1"&gt;'
    from /Users/ShayneChow/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'&lt;/span&gt;
    from /Users/ShayneChow/project/lexuan/config/boot.rb:4:in &lt;span class="sb"&gt;`&lt;/span&gt;&amp;lt;top &lt;span class="o"&gt;(&lt;/span&gt;required&lt;span class="o"&gt;)&amp;gt;&lt;/span&gt;&lt;span class="s1"&gt;'
    from /Users/ShayneChow/project/lexuan/bin/rails:3:in `require_relative'&lt;/span&gt;
    from /Users/ShayneChow/project/lexuan/bin/rails:3:in &lt;span class="sb"&gt;`&lt;/span&gt;&amp;lt;top &lt;span class="o"&gt;(&lt;/span&gt;required&lt;span class="o"&gt;)&amp;gt;&lt;/span&gt;&lt;span class="s1"&gt;'
    from -e:1:in `load'&lt;/span&gt;
    from &lt;span class="nt"&gt;-e&lt;/span&gt;:1:in &lt;span class="sb"&gt;`&lt;/span&gt;&amp;lt;main&amp;gt;&lt;span class="s1"&gt;'

Process finished with exit code 1

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Mac OS X 10.9.2
ruby 2.0.0
rails 4.0.2
不知道是不是我的环境有问题，求解救&lt;/p&gt;

&lt;p&gt;折腾太久这个问题，于是在 &lt;a href="/yehualiu" class="user-mention" title="@yehualiu"&gt;&lt;i&gt;@&lt;/i&gt;yehualiu&lt;/a&gt; 的建议下选择了另一个 gem 'easy_captcha'
使用起来挺方便的。
不过还是有个问题，就是 rails s 后，报了很多很多警告，跟 rmagick 相关的（摘一段如下）&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;warning: already initialized constant Magick::PercentGeometry
warning: previous definition of PercentGeometry was here
warning: already initialized constant Magick::AspectGeometry
warning: previous definition of AspectGeometry was here
warning: already initialized constant Magick::LessGeometry
warning: previous definition of LessGeometry was here
……
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;不知道会不会存在风险。
高人路过，不吝赐教，在此谢过。&lt;/p&gt;</description>
      <author>ShayneChow</author>
      <pubDate>Wed, 26 Mar 2014 14:43:54 +0800</pubDate>
      <link>https://ruby-china.org/topics/18176</link>
      <guid>https://ruby-china.org/topics/18176</guid>
    </item>
    <item>
      <title>[已解决，服务器内存不足] 在服务器端 gem 'nokogiri'安装不上，本地测试很正常</title>
      <description>&lt;p&gt;服务器上跑了 bundle，结果出错，上图
&lt;img src="//l.ruby-china.com/photo/2014/d635d01620765fa820f803417207f0e8.jpg" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="//l.ruby-china.com/photo/2014/c4aa6296530c0335b7e23bb5a4116973.jpg" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="//l.ruby-china.com/photo/2014/d97528d481fbad0d5e9a02e192cc8d69.jpg" title="" alt=""&gt;&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;libxslt-dev libxml2-dev

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;libxslt-dev libxml2-dev 也已经安装了。网上搜索 说是没有这两个库。但是安装了还是报错。&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gem &lt;span class="nb"&gt;install &lt;/span&gt;nokogiri &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s1"&gt;'1.6.1'&lt;/span&gt;
Building native extensions.  This could take a &lt;span class="k"&gt;while&lt;/span&gt;...
ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb
Cannot allocate memory - /usr/local/rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb 2&amp;gt;&amp;amp;1

Gem files will remain installed &lt;span class="k"&gt;in&lt;/span&gt; /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.1 &lt;span class="k"&gt;for &lt;/span&gt;inspection.
Results logged to /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/extensions/x86_64-linux/2.0.0/nokogiri-1.6.1/gem_make.out
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>ShayneChow</author>
      <pubDate>Fri, 21 Mar 2014 20:00:12 +0800</pubDate>
      <link>https://ruby-china.org/topics/18078</link>
      <guid>https://ruby-china.org/topics/18078</guid>
    </item>
    <item>
      <title>发现还有这么个板块牛人很多，于是也来发发图</title>
      <description>&lt;p&gt;画画的水平很一般，没学过，就是喜欢无聊的时候画上几笔。基本都是临摹的，创造性不强。
PS AI 什么的，没用过，都不会。姑且看看 2 张手绘的吧，ruby 新手，画画新手，轻点拍砖。
Bi-Bo Bi-Bo 救火小黄人
&lt;img src="//l.ruby-china.com/photo/2014/04e78d8c5f92a2d6bf058ffe60deabfd.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;格鲁
&lt;img src="//l.ruby-china.com/photo/2014/9ce88b47bf24117cd518703c6ccea306.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;前些时晚上憋不出代码，画了几张调节心情。最后手机拍的上传，不太清晰，光线也不太好。&lt;/p&gt;</description>
      <author>ShayneChow</author>
      <pubDate>Sat, 25 Jan 2014 09:51:31 +0800</pubDate>
      <link>https://ruby-china.org/topics/16984</link>
      <guid>https://ruby-china.org/topics/16984</guid>
    </item>
    <item>
      <title>访问 Github 一直跳转到帮助界面，不知道如何解决</title>
      <description>&lt;p&gt;每次访问 github 都会指向 &lt;a href="https://help.github.com/articles/why-did-i-get-redirected-to-this-page#platform-linux" rel="nofollow" target="_blank"&gt;https://help.github.com/articles/why-did-i-get-redirected-to-this-page#platform-linux&lt;/a&gt; 这个帮助页面。
我的一个 Ubuntu 一个 Win7 一个 Android 一个 IOS7 分别使用的 2 个 wifi 均是这个结果，很疑惑，求解啊。&lt;/p&gt;

&lt;p&gt;&lt;img src="//l.ruby-china.com/photo/2013/49b4efa318b496ddf402748d8824fe9d.jpg" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>ShayneChow</author>
      <pubDate>Tue, 12 Nov 2013 11:48:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/15477</link>
      <guid>https://ruby-china.org/topics/15477</guid>
    </item>
    <item>
      <title>使用 ransack 按发布时间范围搜索的一个问题</title>
      <description>&lt;p&gt;运单号有默认的 created_at 这个字段，
我想使用发布时间（created_at）来做范围限制：创建时间由_______ 到_______  搜索
大概齐是这个样子的。&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sx"&gt;%= f.label :created_at_gteq, "创建时间由" %&amp;gt;
&amp;lt;%=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text_field&lt;/span&gt; &lt;span class="ss"&gt;:created_at_gteq&lt;/span&gt; &lt;span class="o"&gt;%&amp;gt;&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sx"&gt;%= f.label :created_at_lteq, "到" %&amp;gt;
&amp;lt;%=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text_field&lt;/span&gt; &lt;span class="ss"&gt;:created_at_lteq&lt;/span&gt; &lt;span class="o"&gt;%&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;问题是默认的 created_at 格式是 created_at: "2013-10-24 03:32:11" 这个样子，搜索时也要按这个格式输入，否则无结果输出。但是我想使用 10-24 由月 - 日格式的方式搜索，这个怎么改呢？
第一次发贴提问，不知道有没有说明白，还望各位前辈大神指点。&lt;/p&gt;</description>
      <author>ShayneChow</author>
      <pubDate>Tue, 29 Oct 2013 15:32:12 +0800</pubDate>
      <link>https://ruby-china.org/topics/15124</link>
      <guid>https://ruby-china.org/topics/15124</guid>
    </item>
  </channel>
</rss>
