<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>sitoto (eshow)</title>
    <link>https://ruby-china.org/sitoto</link>
    <description>八千里路云和月</description>
    <language>en-us</language>
    <item>
      <title>有朋友在国内服务器上通过 Kamal 成功部署 Rails 应用吗？</title>
      <description>&lt;p&gt;最近用 Kamal 在国内阿里云服务器上部署，这个网络问题不好解决。
在本地和服务器都装了 xray, 在 config/deploy.yml 里面配置了环境变量代理。&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;
&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;yml&lt;/span&gt;
&lt;span class="ss"&gt;servers:
  web:
    &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;demo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;txxx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;txxx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;tag1&lt;/span&gt;


&lt;span class="ss"&gt;env:
  tags:
    tag1: 
      http_proxy: &lt;/span&gt;&lt;span class="s1"&gt;'http://127.0.0.1:10809'&lt;/span&gt;
      &lt;span class="ss"&gt;https_proxy: &lt;/span&gt;&lt;span class="s1"&gt;'http://127.0.0.1:10809'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;</description>
      <author>sitoto</author>
      <pubDate>Sun, 30 Mar 2025 20:38:55 +0800</pubDate>
      <link>https://ruby-china.org/topics/44113</link>
      <guid>https://ruby-china.org/topics/44113</guid>
    </item>
    <item>
      <title>我有一个小建议，能不能加个求职的分类</title>
      <description>&lt;p&gt;顶部只有招聘，为啥不加个求职呢？&lt;/p&gt;</description>
      <author>sitoto</author>
      <pubDate>Mon, 26 Jun 2023 14:37:39 +0800</pubDate>
      <link>https://ruby-china.org/topics/43197</link>
      <guid>https://ruby-china.org/topics/43197</guid>
    </item>
    <item>
      <title>请教个问题: 为什么 wget  返回'416 Requested Range Not Satisfiable' 如下</title>
      <description>&lt;pre&gt;&amp;gt; wget 'https://www.summitracing.com/'

--2017-04-07 17:12:00--  https://www.summitracing.com/

Resolving www.summitracing.com (www.summitracing.com)... 198.7.31.87

Connecting to www.summitracing.com (www.summitracing.com)|198.7.31.87|:443... connected.

HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable


    The file is already fully retrieved; nothing to do.

416 Requested Range Not Satisfiable
&lt;/pre&gt;</description>
      <author>sitoto</author>
      <pubDate>Fri, 07 Apr 2017 17:15:07 +0800</pubDate>
      <link>https://ruby-china.org/topics/32722</link>
      <guid>https://ruby-china.org/topics/32722</guid>
    </item>
    <item>
      <title>早就听说 Linode 要免费升级，为什么日本节点还没有动静</title>
      <description>&lt;p&gt;早就听说 linode 要免费升级，为什么日本节点还没有动静，什么时候才能升级啊？&lt;/p&gt;</description>
      <author>sitoto</author>
      <pubDate>Mon, 20 Feb 2017 18:00:19 +0800</pubDate>
      <link>https://ruby-china.org/topics/32343</link>
      <guid>https://ruby-china.org/topics/32343</guid>
    </item>
    <item>
      <title>MongoDB+Mongoid 的长时间运行后，运行前 100 条就结束</title>
      <description>&lt;p&gt;我使用 Mongoid 连接 MongoDB；&lt;/p&gt;

&lt;p&gt;MongoDB shell version : 2.4.6
mongoid (3.0.0.rc)&lt;/p&gt;

&lt;p&gt;我有 500 个任务 存储在 mongodb 数据库中&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;tasks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Tasks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;
&lt;span class="n"&gt;tasks&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="n"&gt;task&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="c1"&gt;#  doing 大概每个要花费  2-3分钟 。。&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;××问题出现了，当依次 执行到 第 100 个 task 的时候（估计花了 2-3 个小时），程序就自动停止了。××&lt;/p&gt;

&lt;p&gt;============
是 session 的问题？&lt;/p&gt;</description>
      <author>sitoto</author>
      <pubDate>Tue, 17 Sep 2013 09:54:26 +0800</pubDate>
      <link>https://ruby-china.org/topics/14174</link>
      <guid>https://ruby-china.org/topics/14174</guid>
    </item>
    <item>
      <title>如何把 正则表达式 存储到 mongodb 里面 (mongoid)</title>
      <description>&lt;p&gt;Mongoid 的  里面有 Regexp 的 类型 &lt;/p&gt;

&lt;p&gt;我定义如下 &lt;/p&gt;

&lt;p&gt;&lt;code&gt;field  :name_reg,  :type =&amp;gt; Regexp&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;运行却报错，请教一下，如何把 正则表达式存储到 mongodb 里面 
×××××××××××××××
Routing Error&lt;/p&gt;

&lt;p&gt;undefined method `instantiate' for Regexp:Class
Try running rake routes for more information on available routes.
×××××××××××××××××&lt;/p&gt;

&lt;p&gt;Below is a list of valid types for fields.&lt;/p&gt;

&lt;p&gt;Array
BigDecimal
Boolean
Date
DateTime
Float
Hash
Integer
Moped::BSON::ObjectId
Moped::BSON::Binary
Range
&lt;strong&gt;Regexp&lt;/strong&gt;
String
Symbol
Time
TimeWithZone&lt;/p&gt;</description>
      <author>sitoto</author>
      <pubDate>Fri, 19 Jul 2013 14:23:48 +0800</pubDate>
      <link>https://ruby-china.org/topics/12615</link>
      <guid>https://ruby-china.org/topics/12615</guid>
    </item>
    <item>
      <title>Mongoid 的 limit 设置怎么没效？</title>
      <description>&lt;p&gt;topic  = Topic.limit(100).where(:status =&amp;gt; 0)&lt;/p&gt;

&lt;p&gt;topic.count   #30000&lt;/p&gt;

&lt;p&gt;limit 怎么没有生效呢？&lt;/p&gt;</description>
      <author>sitoto</author>
      <pubDate>Wed, 31 Oct 2012 11:21:37 +0800</pubDate>
      <link>https://ruby-china.org/topics/6423</link>
      <guid>https://ruby-china.org/topics/6423</guid>
    </item>
    <item>
      <title>如何开始写测试代码？</title>
      <description>&lt;p&gt;开始编程也有些年了，但是测试代码一直都极少写，包括单元测试、TDD、BDD 也是多有了解，但写起来总觉得很是别扭，往往只能开个头，写一点测试代码，然后就搁置一边，再不问津，再也没写了。。。
    请教各位，如何才能够 把测试代码写下去，如何才能写测试代码？&lt;/p&gt;</description>
      <author>sitoto</author>
      <pubDate>Mon, 22 Oct 2012 09:34:41 +0800</pubDate>
      <link>https://ruby-china.org/topics/6223</link>
      <guid>https://ruby-china.org/topics/6223</guid>
    </item>
    <item>
      <title>topic embed posts 的情况下，如何分页显示 posts 呢？</title>
      <description>&lt;p&gt;topic embed posts 的情况下，如何分页显示 posts 呢？&lt;img title=":eyes:" alt="👀" src="https://twemoji.ruby-china.com/2/svg/1f440.svg" class="twemoji"&gt;&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;Topic&lt;/span&gt;
     &lt;span class="kp"&gt;include&lt;/span&gt; &lt;span class="no"&gt;Mongoid&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Document&lt;/span&gt;
     &lt;span class="n"&gt;field&lt;/span&gt; &lt;span class="ss"&gt;:title&lt;/span&gt;
     &lt;span class="n"&gt;field&lt;/span&gt; &lt;span class="ss"&gt;:body&lt;/span&gt;
     &lt;span class="n"&gt;embed_many&lt;/span&gt; &lt;span class="ss"&gt;:posts&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Post&lt;/span&gt;
    &lt;span class="kp"&gt;include&lt;/span&gt; &lt;span class="no"&gt;Mongoid&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Document&lt;/span&gt;
    &lt;span class="n"&gt;field&lt;/span&gt; &lt;span class="ss"&gt;:content&lt;/span&gt;
    &lt;span class="n"&gt;embeded_in&lt;/span&gt; &lt;span class="ss"&gt;:topic&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这种结构下，，因为 posts 比较多，是否可以做分页显示？ &lt;/p&gt;

&lt;p&gt;应该是：查询 topic 以及里面 的 部分 posts&lt;/p&gt;</description>
      <author>sitoto</author>
      <pubDate>Sun, 14 Oct 2012 16:59:50 +0800</pubDate>
      <link>https://ruby-china.org/topics/6054</link>
      <guid>https://ruby-china.org/topics/6054</guid>
    </item>
    <item>
      <title>Rails 的开发者们都玩些什么游戏？</title>
      <description>&lt;p&gt;我先说。。。偶尔玩玩魔兽的 角色扮演类游戏，还有植物大战僵尸。。呵呵，主要是有些闷的时候会玩下。频率大概是 3H/周，也有是几个月不玩的。  &lt;/p&gt;</description>
      <author>sitoto</author>
      <pubDate>Sun, 06 May 2012 17:23:28 +0800</pubDate>
      <link>https://ruby-china.org/topics/3106</link>
      <guid>https://ruby-china.org/topics/3106</guid>
    </item>
    <item>
      <title>想在 Kaminari 里面加上一个 Goto 直接跳转到某一页</title>
      <description>&lt;p&gt;目前用 Kaminari 分页插件，有时候页数比较多，想加上一个 Goto 直接跳转到某一页，但是不知道怎么实现。请指点一下。   &lt;/p&gt;</description>
      <author>sitoto</author>
      <pubDate>Wed, 18 Apr 2012 16:47:45 +0800</pubDate>
      <link>https://ruby-china.org/topics/2692</link>
      <guid>https://ruby-china.org/topics/2692</guid>
    </item>
  </channel>
</rss>
