<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>zhujinshou (zhujinshou)</title>
    <link>https://ruby-china.org/zhujinshou</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>gem therubyracer 和 libv8 的安装问题</title>
      <description>&lt;p&gt;在 Ruby China 中已经有人问过关于该问题了，但从这些回答中自己没有找到可以解决本问题的好方式（在 Google 上也搜索了），那位大神拯救一下小白。&lt;/p&gt;

&lt;p&gt;安装环境是 rvm1.27.0 + ruby1.9.3 + Rails3.2.14，在项目目录下进行 bundle install 后会报下面的错误：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Installing therubyracer 0.12.1 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/zhujinshou/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -r ./siteconf20160419-54804-1n7e3ld.rb extconf.rb --use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/zhujinshou/.rvm/rubies/ruby-1.9.3-p551/bin/ruby
    --with-pthreadlib
    --without-pthreadlib
    --with-objclib
    --without-objclib
    --enable-debug
    --disable-debug
    --with-v8-dir
    --without-v8-dir
    --with-v8-include
    --without-v8-include=${v8-dir}/include
    --with-v8-lib
    --without-v8-lib=${v8-dir}/
/Users/zhujinshou/.rvm/gems/ruby-1.9.3-p551@tsinova_web/gems/libv8-3.16.14.13/ext/libv8/location.rb:50:in `configure': You have chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundle with the libv8 rubygem. However,
it could not be located. please make sure you have a version of
v8 that is compatible with 3.16.14.13 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location

thanks,
The Mgmt

    from /Users/zhujinshou/.rvm/gems/ruby-1.9.3-p551@tsinova_web/gems/libv8-3.16.14.13/lib/libv8.rb:7:in `configure_makefile'
    from extconf.rb:32:in `&amp;lt;main&amp;gt;'

extconf failed, exit code 1

Gem files will remain installed in /Users/zhujinshou/.rvm/gems/ruby-1.9.3-p551@tsinova_web/gems/therubyracer-0.12.1 for inspection.
Results logged to /Users/zhujinshou/.rvm/gems/ruby-1.9.3-p551@tsinova_web/extensions/x86_64-darwin-15/1.9.1/therubyracer-0.12.1/gem_make.out
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;错误就像上面那样：Failed to build gem native extension.
网上给的装上 libv8 的方法是加上 -- --with-system-v8
但是这明显指标不治本
求助呀，江湖告急，请高手支援！&lt;/p&gt;</description>
      <author>zhujinshou</author>
      <pubDate>Tue, 19 Apr 2016 22:45:48 +0800</pubDate>
      <link>https://ruby-china.org/topics/29779</link>
      <guid>https://ruby-china.org/topics/29779</guid>
    </item>
    <item>
      <title>mini_magic 在进行处理远程二维码图片的路径问题</title>
      <description>&lt;p&gt;今天在进行项目开发时，需要对二维码进行添加标示符的处理：但在执行下面代码后出现了：Errno::ENOENT: No such file or directory 错误（注意我是对远程图片路径进行请求）
#为二维码生成标示符&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;make_qr_flag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
   &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;MiniMagick&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image_url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

   &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;combine_options&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;c&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
     &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;gravity&lt;/span&gt; &lt;span class="s1"&gt;'South'&lt;/span&gt;
     &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pointsize&lt;/span&gt; &lt;span class="s1"&gt;'20'&lt;/span&gt;
     &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;draw&lt;/span&gt; &lt;span class="s2"&gt;"text 3,3 '&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;'"&lt;/span&gt;
     &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fill&lt;/span&gt; &lt;span class="s1"&gt;'green'&lt;/span&gt;
   &lt;span class="k"&gt;end&lt;/span&gt;

   &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image_url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
   &lt;span class="n"&gt;image_url&lt;/span&gt;
 &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>zhujinshou</author>
      <pubDate>Thu, 07 Aug 2014 15:39:07 +0800</pubDate>
      <link>https://ruby-china.org/topics/20890</link>
      <guid>https://ruby-china.org/topics/20890</guid>
    </item>
  </channel>
</rss>
