<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>newbie</title>
    <link>https://ruby-china.org/newbie</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>用 Rails 的 rake 或 rails runner 执行批处理时，带多个参数大家是怎么做的？</title>
      <description>&lt;p&gt;比如我要这样用一个批处理：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;bundle&lt;/span&gt; &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="n"&gt;rails&lt;/span&gt; &lt;span class="n"&gt;runner&lt;/span&gt; &lt;span class="no"&gt;MyTask&lt;/span&gt; &lt;span class="n"&gt;hello&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;params1&lt;/span&gt; &lt;span class="s1"&gt;'1'&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;params2&lt;/span&gt; &lt;span class="s1"&gt;'2'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这时执行时会提示：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ERROR: "rails_runner help" was called with arguments ["--params1", "1", "--params2", "2"]
Usage: "rails_runner help [COMMAND]"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;为什么会提示 &lt;code&gt;rails_runner&lt;/code&gt; ？不加参数可以正常执行 &lt;code&gt;hello&lt;/code&gt; 方法。&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;如果用 &lt;code&gt;Thor&lt;/code&gt; ，可以专门做命令行接口，但把它放到 rails 的 &lt;code&gt;lib/tasks&lt;/code&gt; 下似乎不能访问 &lt;code&gt;Active Record&lt;/code&gt;，是这样吗？&lt;/p&gt;</description>
      <author>newbie</author>
      <pubDate>Tue, 23 Jun 2015 09:19:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/26135</link>
      <guid>https://ruby-china.org/topics/26135</guid>
    </item>
    <item>
      <title>误敲一个域名，得到意外发现，不得其解</title>
      <description>&lt;p&gt;如图，本想访问 Speaker Deck，不小心在最后多敲了一个点，结果出现 Heroku 的页面，产生两个问题：&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;它被部署在 Heroku 上了吗？&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;com.&lt;/code&gt; 的含义是什么？域名还有这个学问？这个重置原理是什么？（都算作第二个问题吧）&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2015/ae92d31623c81d5b9d5b5fb1b9a8d39b.png" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>newbie</author>
      <pubDate>Tue, 10 Feb 2015 15:53:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/24202</link>
      <guid>https://ruby-china.org/topics/24202</guid>
    </item>
    <item>
      <title>部署 Nginx + Unicorn 时连接 sock 错误是什么原因呢？</title>
      <description>&lt;p&gt;nginx 配置 (/etc/nginx/sites-enabled/default) 中：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;upstream&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;# Path to Unicorn SOCK file, as defined previously&lt;/span&gt;
    &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="n"&gt;unix&lt;/span&gt;&lt;span class="ss"&gt;:/&lt;/span&gt;&lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;unicorn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;myapp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sock&lt;/span&gt; &lt;span class="n"&gt;fail_timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;


    &lt;span class="n"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;server_name&lt;/span&gt; &lt;span class="n"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;# Application root, as defined previously&lt;/span&gt;
    &lt;span class="n"&gt;root&lt;/span&gt; &lt;span class="sr"&gt;/root/m&lt;/span&gt;&lt;span class="n"&gt;y_app&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="kp"&gt;public&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;try_files&lt;/span&gt; &lt;span class="vg"&gt;$uri&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;html&lt;/span&gt; &lt;span class="vg"&gt;$uri&lt;/span&gt; &lt;span class="vi"&gt;@app&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;location&lt;/span&gt; &lt;span class="vi"&gt;@app&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;proxy_set_header&lt;/span&gt; &lt;span class="no"&gt;X&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;Forwarded&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;For&lt;/span&gt; &lt;span class="vg"&gt;$proxy_add_x_forwarded_for&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;proxy_set_header&lt;/span&gt; &lt;span class="no"&gt;Host&lt;/span&gt; &lt;span class="vg"&gt;$http_host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;proxy_redirect&lt;/span&gt; &lt;span class="n"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;proxy_pass&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="ss"&gt;:/&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;error_page&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt; &lt;span class="mi"&gt;502&lt;/span&gt; &lt;span class="mi"&gt;503&lt;/span&gt; &lt;span class="mi"&gt;504&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;html&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;client_max_body_size&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="no"&gt;G&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;keepalive_timeout&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;我访问网站时 nginx 的 error log &lt;code&gt;/var/log/nginx/error.log&lt;/code&gt; 中出现下面错误：&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;14/08/24 07:55:50 &lt;span class="o"&gt;[&lt;/span&gt;error] 26968#0: &lt;span class="k"&gt;*&lt;/span&gt;1 connect&lt;span class="o"&gt;()&lt;/span&gt; to unix:/tmp/unicorn.myapp.sock failed &lt;span class="o"&gt;(&lt;/span&gt;111: Connection refused&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;while &lt;/span&gt;connecting to upstream, client: 123.456.789.012, server: localhost, request: &lt;span class="s2"&gt;"GET / HTTP/1.1"&lt;/span&gt;, upstream: &lt;span class="s2"&gt;"http://unix:/tmp/unicorn.myapp.sock:/"&lt;/span&gt;, host: &lt;span class="s2"&gt;"123.456.789.012"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;查了下相关信息，这里有一样的情况：&lt;/p&gt;

&lt;p&gt;&lt;a href="http://stackoverflow.com/questions/5707938/unicorn-nginx-upstream-server-not-starting" rel="nofollow" target="_blank"&gt;http://stackoverflow.com/questions/5707938/unicorn-nginx-upstream-server-not-starting&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;但把 unix:/tmp/sockets/unicorn.sock 改成 127.0.0.1:3000，还是 Connect refused 错误。&lt;/p&gt;

&lt;p&gt;具体原因在哪里呢？&lt;/p&gt;</description>
      <author>newbie</author>
      <pubDate>Sun, 24 Aug 2014 16:10:34 +0800</pubDate>
      <link>https://ruby-china.org/topics/21201</link>
      <guid>https://ruby-china.org/topics/21201</guid>
    </item>
    <item>
      <title>用 Rails 的 Helper raw 显示数据，破坏了 html 格式怎么办？</title>
      <description>&lt;p&gt;数据库中插入一条这样的数据：&lt;/p&gt;

&lt;p&gt;books&lt;/p&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="c1"&gt;---|---|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;|&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;table&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;|&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这样读出来后，在视图曾这样写的时候：&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;%= raw book.content %&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;就破坏了原来的表格，但还是想把内容直观显示出来，怎么办？&lt;/p&gt;</description>
      <author>newbie</author>
      <pubDate>Fri, 22 Aug 2014 14:02:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/21180</link>
      <guid>https://ruby-china.org/topics/21180</guid>
    </item>
    <item>
      <title>大家都用什么方式导入项目所需的基本数据？</title>
      <description>&lt;p&gt;现在团队的做法是，用 Excel 编辑大量程序初期所需基础数据，然后写宏转换成 SQL 的 insert 语句并生成相关文件，再用还原的方式导入到数据库中。
有没有更好的办法？&lt;/p&gt;

&lt;p&gt;seed_fu 这个 gem 可以导入，但编辑起数据还不是太方便。&lt;/p&gt;</description>
      <author>newbie</author>
      <pubDate>Wed, 09 Jul 2014 11:39:22 +0800</pubDate>
      <link>https://ruby-china.org/topics/20396</link>
      <guid>https://ruby-china.org/topics/20396</guid>
    </item>
    <item>
      <title>FactoryGirl 主从表的数据怎么造？</title>
      <description>&lt;h2 id="主表"&gt;主表&lt;/h2&gt;&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;FactoryGirl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;define&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="n"&gt;factory&lt;/span&gt; &lt;span class="ss"&gt;:school&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;f&lt;/span&gt;&lt;span class="o"&gt;|&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;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"school0"&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;h2 id="从表"&gt;从表&lt;/h2&gt;&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;FactoryGirl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;define&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="n"&gt;factory&lt;/span&gt; &lt;span class="ss"&gt;:student&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;f&lt;/span&gt;&lt;span class="o"&gt;|&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;school_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="c1"&gt;# 这里怎么把主表school创建的记录ID设置到这？&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;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"zhangsan"&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;</description>
      <author>newbie</author>
      <pubDate>Mon, 02 Jun 2014 09:57:50 +0800</pubDate>
      <link>https://ruby-china.org/topics/19675</link>
      <guid>https://ruby-china.org/topics/19675</guid>
    </item>
    <item>
      <title>通过 passenger-install-nginx-module 安装的 nginx 和直接安装的 nginx 有什么区别？</title>
      <description>&lt;p&gt;系统中的 nginx 是这样安装的&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;nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;安装了 passenger 后&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gem &lt;span class="nb"&gt;install &lt;/span&gt;passenger
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;还需安装 nginx module 才能在 nginx 中配置使用它。在安装时&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;passenger-install-nginx-module
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;提示&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Automatically download and &lt;span class="nb"&gt;install &lt;/span&gt;Nginx?

Nginx doesn&lt;span class="s1"&gt;'t support loadable modules such as some other web servers do,
so in order to install Nginx with Passenger support, it must be recompiled.

Do you want this installer to download, compile and install Nginx for you?

 1. Yes: download, compile and install Nginx for me. (recommended)
    The easiest way to get started. A stock Nginx 1.4.4 with Passenger
    support, but with no other additional third party modules, will be
    installed for you to a directory of your choice.

 2. No: I want to customize my Nginx installation. (for advanced users)
    Choose this if you want to compile Nginx with more third party modules
    besides Passenger, or if you need to pass additional options to Nginx'&lt;/span&gt;s
    &lt;span class="s1"&gt;'configure'&lt;/span&gt; script. This installer will  1&lt;span class="o"&gt;)&lt;/span&gt; ask you &lt;span class="k"&gt;for &lt;/span&gt;the location of
    the Nginx &lt;span class="nb"&gt;source &lt;/span&gt;code,  2&lt;span class="o"&gt;)&lt;/span&gt; run the &lt;span class="s1"&gt;'configure'&lt;/span&gt; script according to your
    instructions, and  3&lt;span class="o"&gt;)&lt;/span&gt; run &lt;span class="s1"&gt;'make install'&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;

Whichever you choose, &lt;span class="k"&gt;if &lt;/span&gt;you already have an existing Nginx configuration file,
&lt;span class="k"&gt;then &lt;/span&gt;it will be preserved.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;【问题 1】这样再次安装 nginx 的话，和原来的版本没有冲突吗？&lt;/p&gt;

&lt;p&gt;直接安装的 nginx 的启动方法是&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;service nginx start
&lt;span class="nb"&gt;sudo &lt;/span&gt;service nginx restart
&lt;span class="nb"&gt;sudo &lt;/span&gt;service nginx stop
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;通过 &lt;code&gt;passenger-install-nginx-module&lt;/code&gt; 安装的 nginx 的启动方法是&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nginx
&lt;span class="nb"&gt;sudo &lt;/span&gt;nginx &lt;span class="nt"&gt;-s&lt;/span&gt; reload
&lt;span class="nb"&gt;sudo &lt;/span&gt;nginx &lt;span class="nt"&gt;-s&lt;/span&gt; stop
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;【问题 2】为什么会有这样的区别呢？&lt;/p&gt;

&lt;p&gt;【问题 3】在已经存在 nginx 的系统中，有其它方式安装 passenger 的 nginx module 吗？&lt;/p&gt;</description>
      <author>newbie</author>
      <pubDate>Thu, 19 Dec 2013 10:48:54 +0800</pubDate>
      <link>https://ruby-china.org/topics/16303</link>
      <guid>https://ruby-china.org/topics/16303</guid>
    </item>
    <item>
      <title>ruby 1.8.7 如何安装 libxml-ruby 0.8.3？</title>
      <description>&lt;p&gt;ruby 版本：1.8.7
OS: Ubuntu12.04&lt;/p&gt;

&lt;p&gt;在 rails 项目下执行安装 gemfile 的命令&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bundle install --path .bundle&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;得到下面结果&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb 
extconf.rb:6: stack level too deep &lt;span class="o"&gt;(&lt;/span&gt;SystemStackError&lt;span class="o"&gt;)&lt;/span&gt;


Gem files will remain installed &lt;span class="k"&gt;in&lt;/span&gt; /home/username/path/.bundle/ruby/1.9.1/gems/libxml-ruby-0.8.3 &lt;span class="k"&gt;for &lt;/span&gt;inspection.
Results logged to /home/username/path/.bundle/ruby/1.9.1/gems/libxml-ruby-0.8.3/ext/libxml/gem_make.out

An error occurred &lt;span class="k"&gt;while &lt;/span&gt;installing libxml-ruby &lt;span class="o"&gt;(&lt;/span&gt;0.8.3&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;libxml-ruby &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s1"&gt;'0.8.3'&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt; succeeds before bundling.

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;运行&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo gem install libxml-ruby -v '0.8.3'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;却提示：&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
Building native extensions.  This could take a &lt;span class="k"&gt;while&lt;/span&gt;...
Successfully installed libxml-ruby-0.8.3
Installing ri documentation &lt;span class="k"&gt;for &lt;/span&gt;libxml-ruby-0.8.3

No definition &lt;span class="k"&gt;for &lt;/span&gt;input_callbacks_add_scheme

No definition &lt;span class="k"&gt;for &lt;/span&gt;input_callbacks_remove_scheme

No definition &lt;span class="k"&gt;for &lt;/span&gt;ruby_xml_node2_new_native

Enclosing class/module &lt;span class="s1"&gt;'cXMLSaxParser'&lt;/span&gt; &lt;span class="k"&gt;for &lt;/span&gt;module Callbacks not known

No definition &lt;span class="k"&gt;for &lt;/span&gt;ruby_xml_html_parser_new_file

No definition &lt;span class="k"&gt;for &lt;/span&gt;ruby_xml_html_parser_new_io

No definition &lt;span class="k"&gt;for &lt;/span&gt;ruby_xml_html_parser_filename_get

No definition &lt;span class="k"&gt;for &lt;/span&gt;ruby_xml_html_parser_filename_set

No definition &lt;span class="k"&gt;for &lt;/span&gt;ruby_xml_html_parser_io_get

No definition &lt;span class="k"&gt;for &lt;/span&gt;ruby_xml_html_parser_io_set

No definition &lt;span class="k"&gt;for &lt;/span&gt;ruby_xml_parser_context_options_get

No definition &lt;span class="k"&gt;for &lt;/span&gt;ruby_xml_parser_context_options_set
/usr/local/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/usr/local/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Done installing documentation &lt;span class="k"&gt;for &lt;/span&gt;libxml-ruby after 2 seconds
1 gem installed

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;但 Gemfile.lock 没法正常生成。&lt;/p&gt;</description>
      <author>newbie</author>
      <pubDate>Mon, 16 Dec 2013 17:21:35 +0800</pubDate>
      <link>https://ruby-china.org/topics/16231</link>
      <guid>https://ruby-china.org/topics/16231</guid>
    </item>
    <item>
      <title>如何改变 rvm 的 gemdir？</title>
      <description>&lt;pre class="highlight shell"&gt;&lt;code&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;rvm use system
ruby 1.8.7 &lt;span class="o"&gt;(&lt;/span&gt;2013-06-27 patchlevel 374&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;x86_64-linux]

&lt;span class="nv"&gt;$ &lt;/span&gt;rvm gemset list_all

gemsets &lt;span class="k"&gt;for &lt;/span&gt;ruby-1.8.7-p374 &lt;span class="o"&gt;(&lt;/span&gt;found &lt;span class="k"&gt;in&lt;/span&gt; /home/username/.rvm/gems/ruby-1.8.7-p374&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;default&lt;span class="o"&gt;)&lt;/span&gt;
   global

gemsets &lt;span class="k"&gt;for &lt;/span&gt;ruby-2.0.0-p247 &lt;span class="o"&gt;(&lt;/span&gt;found &lt;span class="k"&gt;in&lt;/span&gt; /home/username/.rvm/gems/ruby-2.0.0-p247&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;default&lt;span class="o"&gt;)&lt;/span&gt;
   global

gemsets &lt;span class="k"&gt;for &lt;/span&gt;ruby-1.9.3-p448 &lt;span class="o"&gt;(&lt;/span&gt;found &lt;span class="k"&gt;in&lt;/span&gt; /home/username/.rvm/gems/ruby-1.9.3-p448&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;default&lt;span class="o"&gt;)&lt;/span&gt;
   global

&lt;span class="nv"&gt;$ &lt;/span&gt;rvm gemdir 1.8.7

&lt;span class="nv"&gt;$ &lt;/span&gt;gem &lt;span class="nb"&gt;env

&lt;/span&gt;RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.17
  - RUBY VERSION: 2.0.0 &lt;span class="o"&gt;(&lt;/span&gt;2013-06-27 patchlevel 247&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;x86_64-linux]
  - INSTALLATION DIRECTORY: /home/username/.rvm/gems/ruby-2.0.0-p247
  - RUBY EXECUTABLE: /home/username/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
  - EXECUTABLE DIRECTORY: /home/username/.rvm/gems/ruby-2.0.0-p247/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/username/.rvm/gems/ruby-2.0.0-p247
     - /home/username/.rvm/gems/ruby-2.0.0-p247@global
  - GEM CONFIGURATION:
     - :update_sources &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;
     - :verbose &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;
     - :benchmark &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;
     - :backtrace &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;false&lt;/span&gt;
     - :bulk_threshold &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;运行 &lt;code&gt;rvm gemdir 1.8.7&lt;/code&gt; 结果还是 &lt;code&gt;/home/username/.rvm/gems/ruby-2.0.0-p247&lt;/code&gt;，怎么换到 &lt;code&gt;ruby-1.8.7-p374&lt;/code&gt; ？&lt;/p&gt;</description>
      <author>newbie</author>
      <pubDate>Fri, 13 Dec 2013 11:35:04 +0800</pubDate>
      <link>https://ruby-china.org/topics/16176</link>
      <guid>https://ruby-china.org/topics/16176</guid>
    </item>
  </channel>
</rss>
