<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>shinefine (shinefine)</title>
    <link>https://ruby-china.org/shinefine</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>Ruby 输出中文字符的问题</title>
      <description>&lt;pre class="highlight plaintext"&gt;&lt;code&gt;obj= {name: "小明"}
p obj
puts obj
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;输出结果&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{:name=&amp;gt;"\u5C0F\u660E"}
{:name=&amp;gt;"\u5C0F\u660E"}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;我希望的输出结果为中文&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{:name=&amp;gt;"小明"}
{:name=&amp;gt;"小明"}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;设置了 STDOUT.external_encoding ,STDOUT.internal_encoding ,encoding 都没有效果，请教应该怎样达到目的&lt;/p&gt;</description>
      <author>shinefine</author>
      <pubDate>Tue, 15 Nov 2016 10:47:19 +0800</pubDate>
      <link>https://ruby-china.org/topics/31597</link>
      <guid>https://ruby-china.org/topics/31597</guid>
    </item>
    <item>
      <title>[assets pipeline 相关] semantic-ui 的图标文字在产品环境下无法正常显示</title>
      <description>&lt;p&gt;一个 rails 项目，在 Gemfile 中声明使用 Gem 包     gem 'semantic-ui-sass'  &lt;/p&gt;

&lt;p&gt;semantic-ui 自带了一系列的图标文字，这些，可以通过在 html 文件中以类似于&lt;/p&gt;

&lt;p&gt;&lt;i class="circular code link icon"&gt;&lt;/i&gt;    --- (页面呈现一个文字，看起来像个图标)&lt;/p&gt;

&lt;p&gt;的方式使用。&lt;/p&gt;

&lt;p&gt;包含这些图标文字的字体文件处于 semantic-ui-sass gem 包的 安装路径（xxxxx/ruby/gems/2.1.0/gems/semantic-ui-sass-0.16.1.0/
）的 app/assets/fonts/semantic-ui/ 路径下&lt;/p&gt;

&lt;p&gt;具体包含图标文字的字体文件  :
    basic.icons.eot
    basic.icons.woff
    basic.icons.svg
    icons.svg
    icons.woff
    ...
    ...&lt;/p&gt;

&lt;p&gt;我在项目视图文件 index.html.erb 的引用了 semantic-ui 的相关 css 和 javascript 文件，在视图文件中，通过
&lt;i class="circular code link icon"&gt;&lt;/i&gt; 想在页面呈现一个图标文字。&lt;/p&gt;

&lt;p&gt;在 develop 环境下，浏览器中的 index.html 文件呈现的是正常的，（浏览器请求字体文件 是成功的）&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:3000/assets/semantic-ui/icons.svg" rel="nofollow" target="_blank"&gt;http://localhost:3000/assets/semantic-ui/icons.svg&lt;/a&gt;
&lt;a href="http://localhost:3000/assets/semantic-ui/icons.woff" rel="nofollow" target="_blank"&gt;http://localhost:3000/assets/semantic-ui/icons.woff&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;而在 production 环境下，这些图标文字全部不能显示出来，原因是浏览器请求的图标字体文件不存在&lt;/p&gt;

&lt;p&gt;&lt;a href="http://websitexxxx.com/assets/semantic-ui/basic.icons.woff" rel="nofollow" target="_blank"&gt;http://websitexxxx.com/assets/semantic-ui/basic.icons.woff&lt;/a&gt;
&lt;a href="http://websitexxxx.com/assets/semantic-ui/icons.woff" rel="nofollow" target="_blank"&gt;http://websitexxxx.com/assets/semantic-ui/icons.woff&lt;/a&gt;
报错 
Failed to load resource: the server responded with a status of 404 (Not Found)  &lt;/p&gt;

&lt;p&gt;我查看了项目的 public 文件夹，在 public/assets/semantic-ui/中不存在 basic.icons.woff，icons.woff 这些文件，相应的，是类似于&lt;/p&gt;

&lt;p&gt;basic.icons-f7635aae393b695a44c688db5a0427c3.woff 
icons-18bbbc0f09fd467a4d62cdd70540100c.woff&lt;/p&gt;

&lt;p&gt;这种格式的文件。 （这些文件都是通过 rake assets:precompile 产生出来的）&lt;/p&gt;

&lt;p&gt;请问这个问题应该怎么解决呢？&lt;/p&gt;</description>
      <author>shinefine</author>
      <pubDate>Wed, 20 Aug 2014 10:47:37 +0800</pubDate>
      <link>https://ruby-china.org/topics/21131</link>
      <guid>https://ruby-china.org/topics/21131</guid>
    </item>
  </channel>
</rss>
