<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>jiuxueliang (nine_page)</title>
    <link>https://ruby-china.org/jiuxueliang</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>请教一下：This website is under heavy load (queue full) 怎么办？</title>
      <description>&lt;p&gt;这两天网站访问人数有点多，然后人一多就出现：&lt;/p&gt;
&lt;pre class="highlight erb"&gt;&lt;code&gt;This website is under heavy load (queue full)
       We're sorry, too many people are accessing this website at the same time. We're working on this problem. Please try again later.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这样的提示，然后 passenger_max_request_queue_size 0；也设置了，还是会报错，请问该怎么办。&lt;/p&gt;

&lt;p&gt;passenger 配置：&lt;/p&gt;
&lt;pre class="highlight erb"&gt;&lt;code&gt;passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/passenger_free_ruby;
passenger_max_request_queue_size 0;
&lt;/code&gt;&lt;/pre&gt;&lt;pre class="highlight erb"&gt;&lt;code&gt;server {
        listen 80;

        server_name www.xxx.com;
        root /www/xxx.com/public;
        rails_env production;
        passenger_enabled on;
        passenger_friendly_error_pages on;
}
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>jiuxueliang</author>
      <pubDate>Thu, 02 Aug 2018 14:27:40 +0800</pubDate>
      <link>https://ruby-china.org/topics/37266</link>
      <guid>https://ruby-china.org/topics/37266</guid>
    </item>
    <item>
      <title>请求帮助，我按照教程在 ubuntu14.04 上安装 ngnix + passenger，出现了包依赖错误，请大佬帮我看看。</title>
      <description>&lt;p&gt;我照着 passenger 的官方教程：
&lt;a href="https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/" rel="nofollow" target="_blank"&gt;https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/&lt;/a&gt;
然后执行到
sudo apt-get install -y nginx-extras passenger
命令时出现：&lt;/p&gt;

&lt;p&gt;myuser@ubuntu:~$ sudo apt-get install -y nginx-extras passenger
Reading package lists... Done
Building dependency tree&lt;br&gt;
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:&lt;/p&gt;

&lt;p&gt;The following packages have unmet dependencies:
 nginx-extras : Depends: nginx-common (= 1:1.12.2-8.5.1.12~trusty1) but 1:1.14.0-8.5.3.1~trusty1 is to be installed
                Recommends: passenger (&amp;lt; 5.1.13) but 1:5.1.12-1~trusty1 is to be installed
E: Unable to correct problems, you have held broken packages.
myuser@ubuntu:~$ &lt;/p&gt;

&lt;p&gt;请问，该怎么办？Google 和百度了很久，重装了很多次都不行。&lt;/p&gt;</description>
      <author>jiuxueliang</author>
      <pubDate>Sat, 02 Jun 2018 12:15:32 +0800</pubDate>
      <link>https://ruby-china.org/topics/36883</link>
      <guid>https://ruby-china.org/topics/36883</guid>
    </item>
    <item>
      <title>请教一个关于 cocoon 表单嵌套的问题。</title>
      <description>&lt;p&gt;我要实现的功能是，创建一个客户，但是客户会有很多要上传的资料，所以用到了 cocoon 做嵌套，现在表单做好了，可以删除，增加。但是我在 fields 里面拿不到资料的名称，所以请教一下怎么在 fields 里面拿到对象的属性值。&lt;/p&gt;

&lt;p&gt;代码：
&lt;img src="https://l.ruby-china.com/photo/2018/2ccdab10-9fe7-42a0-863c-251f3a462a88.png!large" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;file_material_fields：&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2018/231aac6b-ca07-41af-8aef-f631711019de.png!large" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>jiuxueliang</author>
      <pubDate>Wed, 21 Mar 2018 10:07:47 +0800</pubDate>
      <link>https://ruby-china.org/topics/35277</link>
      <guid>https://ruby-china.org/topics/35277</guid>
    </item>
    <item>
      <title>请教一下，为什么我的 form_tag 不刷新提交不了。</title>
      <description>&lt;p&gt;功能：&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2018/1cb15a8b-934a-4a4f-954a-3a15cde3d3aa.png!large" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;提交要删除的文章 id，和修改文章顺序。&lt;/p&gt;

&lt;p&gt;我写了一个 form，然后根据按钮的不同通过 js 改变提交地址，再执行 submit()。但是我通过点击 a 标签跳转到这一页的时候，点击排序或删除，表单确实提交了，只是里面的所有 input，check_box 的值却没有提交，返回刷新却能正常使用。然后我不用 js 提交，换成 submit 按钮，同样，第一次点进来按钮点击没反应，刷新一下才正常使用。&lt;/p&gt;</description>
      <author>jiuxueliang</author>
      <pubDate>Thu, 01 Mar 2018 11:06:26 +0800</pubDate>
      <link>https://ruby-china.org/topics/35110</link>
      <guid>https://ruby-china.org/topics/35110</guid>
    </item>
    <item>
      <title>请教一个关于 delayed_job 执行任务的顺序及执行时间的问题。</title>
      <description>&lt;p&gt;我在发邮件的时候调用了 delay(queue: 'mailers') 方法，然后又执行了 RAILS_ENV=production QUEUE=mailers nohup rake jobs:work &amp;amp;命令，邮件是可以发送，但是有的发了，有的没发，我完全弄不懂规律，下图是发送记录：
&lt;img src="https://l.ruby-china.com/photo/2018/9837bfa0-6bf2-4726-aad8-30e5eb487c61.png!large" title="" alt=""&gt;
刚才去线上看了一下，是‘mailers’进程关闭了，导致邮件发不出去。但是我不明白为什么‘mailers’进程会关闭？&lt;/p&gt;</description>
      <author>jiuxueliang</author>
      <pubDate>Thu, 08 Feb 2018 17:42:35 +0800</pubDate>
      <link>https://ruby-china.org/topics/35014</link>
      <guid>https://ruby-china.org/topics/35014</guid>
    </item>
    <item>
      <title>请教诸位一个问题：一个页面两个分页用 gem 是不是不好做？</title>
      <description>&lt;p&gt;分页的 gem 接收的参数都是 page，假如两个分页就会混淆，我的方法是用 js 修改自动生成的 a 标签的链接参数，不知道有没有更好的方式。
还有就是像这样别人的“轮子”用起来不合适，是不是就要重复造自己需要的“轮子”了？&lt;/p&gt;</description>
      <author>jiuxueliang</author>
      <pubDate>Sat, 20 Jan 2018 09:46:14 +0800</pubDate>
      <link>https://ruby-china.org/topics/34925</link>
      <guid>https://ruby-china.org/topics/34925</guid>
    </item>
    <item>
      <title>请教一个关于数据库查询和内存的问题。</title>
      <description>&lt;p&gt;假如有我的主页需要 10 个分类下的 100 篇文章，
        是一次查完：
            &lt;img src="https://l.ruby-china.com/photo/2018/ae8f7215-b773-43b5-aec5-ae2edc531dd8.jpg!large" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;还是分开查：
            &lt;img src="https://l.ruby-china.com/photo/2018/588b517a-c392-4735-8d1f-193d67d6f36f.png!large" title="" alt=""&gt;
            。。。。。。&lt;/p&gt;

&lt;p&gt;哪一种比较好？假如是 100 个分类 1000 篇文章，或是更多呢？&lt;/p&gt;</description>
      <author>jiuxueliang</author>
      <pubDate>Sat, 13 Jan 2018 14:08:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/34877</link>
      <guid>https://ruby-china.org/topics/34877</guid>
    </item>
    <item>
      <title>为什么本站链接出错？</title>
      <description>&lt;p&gt;我搜索 request，然后出了很多帖子，可是帖子链接不对，点击第一个链接的是第二篇内容，以此类推，难道我打开方式不对？&lt;/p&gt;</description>
      <author>jiuxueliang</author>
      <pubDate>Fri, 05 Jan 2018 10:57:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/34826</link>
      <guid>https://ruby-china.org/topics/34826</guid>
    </item>
    <item>
      <title>请教一下怎么不通过打点的方式获取属性值？</title>
      <description>&lt;p&gt;jQuery 可以通过$("this").attr("key") 的方式，也就是某个方法加属性名的方式获取到属性值，那么 Ruby 可以吗？&lt;/p&gt;</description>
      <author>jiuxueliang</author>
      <pubDate>Wed, 03 Jan 2018 10:26:20 +0800</pubDate>
      <link>https://ruby-china.org/topics/34810</link>
      <guid>https://ruby-china.org/topics/34810</guid>
    </item>
    <item>
      <title>request.referrer 获取上级 URL 失败</title>
      <description>&lt;p&gt;我用 request.referrer 获取百度跳转过来的 URL 是可以的，但是获取不到搜狗的，获取谷歌只能获取&lt;a href="https://www.google.com.hk" rel="nofollow" target="_blank"&gt;https://www.google.com.hk&lt;/a&gt;，后面的地址和参数获取不了。请问有人知道什么原因吗？可以解决么？&lt;/p&gt;</description>
      <author>jiuxueliang</author>
      <pubDate>Fri, 01 Sep 2017 10:45:25 +0800</pubDate>
      <link>https://ruby-china.org/topics/33993</link>
      <guid>https://ruby-china.org/topics/33993</guid>
    </item>
  </channel>
</rss>
