<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>wupei1024 (吴培)</title>
    <link>https://ruby-china.org/wupei1024</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>本地正常在服务器上老出这东西，搜索了一通也没找到，有办法定位吗</title>
      <description>&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2018/cb6c9944-5443-4750-bc61-db80aabacae2.png!large" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>wupei1024</author>
      <pubDate>Tue, 31 Jul 2018 15:14:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/37255</link>
      <guid>https://ruby-china.org/topics/37255</guid>
    </item>
    <item>
      <title>ActiveStorage 如果是保存在 local disk,如何和 Nginx 结合</title>
      <description>&lt;p&gt;上传的文件能不能用 nginx 来提供，目前发现他存储后的名称都是随机的。
&lt;img src="https://l.ruby-china.com/photo/2018/5794629e-4a2e-429c-a847-dd0018534e08.png!large" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>wupei1024</author>
      <pubDate>Tue, 03 Jul 2018 23:16:26 +0800</pubDate>
      <link>https://ruby-china.org/topics/37095</link>
      <guid>https://ruby-china.org/topics/37095</guid>
    </item>
    <item>
      <title>ActiveStorage 上传个文件要这么久</title>
      <description>&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2018/363946b6-bfc6-4f7e-b24d-86acd5fd0db9.png!large" title="" alt=""&gt;
而且奇怪的是时间都是花在 uploaded 以后，文件也非常小。
之前直接提交没有发现，
现在改成 ajax 提交，才发现这么慢。&lt;/p&gt;</description>
      <author>wupei1024</author>
      <pubDate>Tue, 03 Jul 2018 22:56:32 +0800</pubDate>
      <link>https://ruby-china.org/topics/37094</link>
      <guid>https://ruby-china.org/topics/37094</guid>
    </item>
    <item>
      <title>关于在页面输出 js 代码的最佳实践，请指教</title>
      <description>&lt;p&gt;我用了一个第三方的 js 库，他必须输入一个 js 数组，然后渲染成 form 元素，我这个数组是从子表中保存的。
我想直接输出到页面上一个 js 数组，感觉这种混合方式不太好。&lt;/p&gt;

&lt;p&gt;再调用 一次 ajax 又感觉有点脱裤子放屁。&lt;/p&gt;

&lt;p&gt;怎么能优雅点。。。&lt;/p&gt;</description>
      <author>wupei1024</author>
      <pubDate>Tue, 03 Jul 2018 20:17:18 +0800</pubDate>
      <link>https://ruby-china.org/topics/37092</link>
      <guid>https://ruby-china.org/topics/37092</guid>
    </item>
    <item>
      <title>ActiveStorage 能自动清理未引用的文件吗？</title>
      <description>&lt;p&gt;了解的大大告诉一下。&lt;/p&gt;</description>
      <author>wupei1024</author>
      <pubDate>Mon, 02 Jul 2018 14:43:35 +0800</pubDate>
      <link>https://ruby-china.org/topics/37078</link>
      <guid>https://ruby-china.org/topics/37078</guid>
    </item>
    <item>
      <title>Rails 开发环境初次访问 javascript_include_tag 超慢。</title>
      <description>&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;*&lt;/span&gt; Environment: development
&lt;span class="k"&gt;*&lt;/span&gt; Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
Started GET &lt;span class="s2"&gt;"/problem_categories"&lt;/span&gt; &lt;span class="k"&gt;for &lt;/span&gt;127.0.0.1 at 2018-06-27 14:41:10 +0800
   &lt;span class="o"&gt;(&lt;/span&gt;1.0ms&lt;span class="o"&gt;)&lt;/span&gt;  SELECT &lt;span class="s2"&gt;"schema_migrations"&lt;/span&gt;.&lt;span class="s2"&gt;"version"&lt;/span&gt; FROM &lt;span class="s2"&gt;"schema_migrations"&lt;/span&gt; ORDER BY &lt;span class="s2"&gt;"schema_migrations"&lt;/span&gt;.&lt;span class="s2"&gt;"version"&lt;/span&gt; ASC
Processing by ProblemCategoriesController#index as HTML
  Rendering problem_categories/index.html.erb within layouts/application
  ProblemCategory Load &lt;span class="o"&gt;(&lt;/span&gt;4.0ms&lt;span class="o"&gt;)&lt;/span&gt;  SELECT &lt;span class="s2"&gt;"problem_categories"&lt;/span&gt;.&lt;span class="k"&gt;*&lt;/span&gt; FROM &lt;span class="s2"&gt;"problem_categories"&lt;/span&gt; ORDER BY &lt;span class="s2"&gt;"problem_categories"&lt;/span&gt;.&lt;span class="s2"&gt;"lft"&lt;/span&gt; ASC
  Rendered problem_categories/index.html.erb within layouts/application &lt;span class="o"&gt;(&lt;/span&gt;55.0ms&lt;span class="o"&gt;)&lt;/span&gt;
  Rendered layouts/partials/_topnavbar.html.erb &lt;span class="o"&gt;(&lt;/span&gt;2.0ms&lt;span class="o"&gt;)&lt;/span&gt;
  Rendered layouts/partials/_sidebar.html.erb &lt;span class="o"&gt;(&lt;/span&gt;1.0ms&lt;span class="o"&gt;)&lt;/span&gt;
  Rendered layouts/partials/_offsidebar.html.erb &lt;span class="o"&gt;(&lt;/span&gt;1.0ms&lt;span class="o"&gt;)&lt;/span&gt;
  Rendered layouts/partials/_footer.html.erb &lt;span class="o"&gt;(&lt;/span&gt;1.0ms&lt;span class="o"&gt;)&lt;/span&gt;
Completed 200 OK &lt;span class="k"&gt;in &lt;/span&gt;258601ms &lt;span class="o"&gt;(&lt;/span&gt;Views: 258541.3ms | ActiveRecord: 9.0ms&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;需要好几分钟才能显示出第一个页面。
现在是 puma，我改为其它服务器也试过一样。&lt;/p&gt;

&lt;p&gt;我发现时间花在 xxxx_include_tag 上，即使是一个空文件，他也要花几分钟。
但是只在第一个遇见的 tag 上花时间，比如同一个页面上有两个，那后面一个也会非常 的快。&lt;/p&gt;

&lt;p&gt;第一次打开以后，后面即使我再修改这个 js 或者 scss，也反应的比较快。&lt;/p&gt;

&lt;p&gt;倒是不太影响开发，但是比较奇怪这个现象。&lt;/p&gt;

&lt;p&gt;也就是说我认为时间并不是花在 compile 本身上。&lt;/p&gt;

&lt;p&gt;production 环境没有这个问题。&lt;/p&gt;</description>
      <author>wupei1024</author>
      <pubDate>Wed, 27 Jun 2018 14:58:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/37058</link>
      <guid>https://ruby-china.org/topics/37058</guid>
    </item>
    <item>
      <title>有没有办法部署的时候把不需要的 scss coffee node_modules 一些不需要的内容删除掉。</title>
      <description>&lt;p&gt;有没有简单的办法，编译完资源以后，只要保障 production 能运行就行了。&lt;/p&gt;</description>
      <author>wupei1024</author>
      <pubDate>Sat, 16 Jun 2018 16:06:55 +0800</pubDate>
      <link>https://ruby-china.org/topics/36958</link>
      <guid>https://ruby-china.org/topics/36958</guid>
    </item>
    <item>
      <title>5.2 生成不了项目。。。</title>
      <description>&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2018/b089632a-896d-40b1-9c47-5075d13bbd48.png!large" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>wupei1024</author>
      <pubDate>Tue, 29 May 2018 18:22:53 +0800</pubDate>
      <link>https://ruby-china.org/topics/36862</link>
      <guid>https://ruby-china.org/topics/36862</guid>
    </item>
    <item>
      <title>什么时候该用 rails generator 什么时候该用 rake</title>
      <description>&lt;p&gt;我做了一个 gem，目的是把默认的 application.html.erb 替换成我要的标准的样子。&lt;/p&gt;

&lt;p&gt;然后再复制一些其它文件过来。&lt;/p&gt;

&lt;p&gt;不知道该用 rails 自定义的 generator 实现还是用 rake
这方面有什么最佳实践么。&lt;/p&gt;</description>
      <author>wupei1024</author>
      <pubDate>Fri, 31 Jul 2015 19:02:32 +0800</pubDate>
      <link>https://ruby-china.org/topics/26727</link>
      <guid>https://ruby-china.org/topics/26727</guid>
    </item>
    <item>
      <title>大家有没有将 warble 用于生产环境的</title>
      <description>&lt;p&gt;稳定性如何？&lt;/p&gt;

&lt;p&gt;只是聊一下&lt;/p&gt;</description>
      <author>wupei1024</author>
      <pubDate>Fri, 17 Jul 2015 15:21:34 +0800</pubDate>
      <link>https://ruby-china.org/topics/26537</link>
      <guid>https://ruby-china.org/topics/26537</guid>
    </item>
    <item>
      <title>如何找到调用者当前方法的对象</title>
      <description>&lt;p&gt;如&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;a&lt;/span&gt; 
&lt;span class="c1"&gt;#如何得到d&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; 
   &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;e&lt;/span&gt;
      &lt;span class="n"&gt;a&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>wupei1024</author>
      <pubDate>Fri, 03 Jul 2015 17:41:51 +0800</pubDate>
      <link>https://ruby-china.org/topics/26318</link>
      <guid>https://ruby-china.org/topics/26318</guid>
    </item>
    <item>
      <title>io/console not supported; tty will not be manipulated</title>
      <description>&lt;p&gt;io/console not supported; tty will not be manipulated&lt;/p&gt;

&lt;p&gt;jruby 调用 activerecord 时出现的这个是什么原因有没有大神遇见过的。&lt;/p&gt;</description>
      <author>wupei1024</author>
      <pubDate>Wed, 17 Jun 2015 09:49:13 +0800</pubDate>
      <link>https://ruby-china.org/topics/26057</link>
      <guid>https://ruby-china.org/topics/26057</guid>
    </item>
    <item>
      <title>新手 jruby,为啥这样了。。</title>
      <description>&lt;p&gt;D:\jruby-9.0.0.0.rc1\bin&amp;gt;jruby -S gem sources -a &lt;a href="https://ruby.taobao.org/" rel="nofollow" target="_blank"&gt;https://ruby.taobao.org/&lt;/a&gt;
&lt;a href="https://ruby.taobao.org/" rel="nofollow" target="_blank"&gt;https://ruby.taobao.org/&lt;/a&gt; added to sources&lt;/p&gt;

&lt;p&gt;D:\jruby-9.0.0.0.rc1\bin&amp;gt;jruby -S gem install rails
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ECONNREFUSED: Connection refused - Connection refused (&lt;a href="https://api.ru" rel="nofollow" target="_blank"&gt;https://api.ru&lt;/a&gt;
bygems.org/quick/Marshal.4.8/rails-4.2.1.gemspec.rz)&lt;/p&gt;

&lt;p&gt;D:\jruby-9.0.0.0.rc1\bin&amp;gt;jruby -S gem install rails
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ECONNREFUSED: Connection refused - Connection refused (&lt;a href="https://api.ru" rel="nofollow" target="_blank"&gt;https://api.ru&lt;/a&gt;
bygems.org/quick/Marshal.4.8/rails-4.2.1.gemspec.rz)&lt;/p&gt;

&lt;p&gt;java 狗一只，
另外我在 java 中运行 activerecord，出了一个这个警告，怎么去掉呢？&lt;/p&gt;

&lt;p&gt;io/console not supported; tty will not be manipulated&lt;/p&gt;

&lt;p&gt;顺便 问下 jruby 的 gem 和 ruby 的 gem 通用吗？像 rails.还是有单独的版本。&lt;/p&gt;</description>
      <author>wupei1024</author>
      <pubDate>Sun, 14 Jun 2015 18:43:53 +0800</pubDate>
      <link>https://ruby-china.org/topics/26015</link>
      <guid>https://ruby-china.org/topics/26015</guid>
    </item>
  </channel>
</rss>
