<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>miqiu1987 (服务器123123)</title>
    <link>https://ruby-china.org/miqiu1987</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>在 redhat 下安装 emacs 时，./configure 报错了，不知道该如何解决，麻烦高手指点一下</title>
      <description>&lt;p&gt;configure: error: You seem to be running X, but no X development libraries
were found.  You should install the relevant development files for X
and for the toolkit you want, such as Gtk+, Lesstif or Motif.  Also make
sure you have development files for image handling, i.e.
tiff, gif, jpeg, png and xpm.
If you are sure you want Emacs compiled without X window support, pass
  --without-x
to configure.
看网上说是需要安装 x 的 dev 库，但是不知道 redhat 能通过什么途径安装这个&lt;/p&gt;</description>
      <author>miqiu1987</author>
      <pubDate>Fri, 09 Aug 2013 19:25:38 +0800</pubDate>
      <link>https://ruby-china.org/topics/13204</link>
      <guid>https://ruby-china.org/topics/13204</guid>
    </item>
    <item>
      <title>ruby 是否支持递归呢？</title>
      <description>&lt;p&gt;class Fib_cal
    def initialize()
        puts "This is initialize!"
    end
    def fib(n)
        i,j,a=1,1,1
        while a&amp;lt;n
           if(i&amp;lt;=j)
              i+=j
           else
              j+=i
           end
           a+=1
        end
        if(i&amp;lt;=j)
          puts "#{i}"
        else
          puts "#{j}"
        end
        puts "fib end!"
    end
    def fib_simple(n)
        res = fib_simple(n-1)+fib_simple(n-2)
        puts "#{res}"
        puts "fib_simple end!"
    end
    def fib_list(n)
        i,j,a=1,1,1
        res=[1,1]
        while a&amp;lt;=n
           if(i&amp;lt;=j)
              i+=j
              res[a+1] = i
           else
              j+=i
              res[a+1] = j
           end
           a+=1
        end
        res.each{|i| puts i}
        puts "fib_list end!"
    end
end&lt;/p&gt;

&lt;p&gt;fib_test = Fib_cal.new
fib_test.fib(5)
fib_test.fib_list(5)
fib_test.fib_simple(5)&lt;/p&gt;

&lt;p&gt;运行报错了：
Fib_cal.rb:23:in &lt;code&gt;fib_simple': stack level too deep (SystemStackError)
    from Fib_cal.rb:23:in&lt;/code&gt;fib_simple'
    from Fib_cal.rb:48
This is initialize!
5
fib end!
1
1
2
3
5
8
13
fib_list end!&lt;/p&gt;</description>
      <author>miqiu1987</author>
      <pubDate>Tue, 06 Aug 2013 20:57:33 +0800</pubDate>
      <link>https://ruby-china.org/topics/13112</link>
      <guid>https://ruby-china.org/topics/13112</guid>
    </item>
    <item>
      <title>初学 ruby，看不出来为什么报错了</title>
      <description>&lt;p&gt;class Leap_year
    def initialize
        puts 'Please input a year:'
    end
    def leap_year?(year)
        &lt;a href="/year" class="user-mention" title="@year"&gt;&lt;i&gt;@&lt;/i&gt;year&lt;/a&gt; = year
        if &lt;a href="/year" class="user-mention" title="@year"&gt;&lt;i&gt;@&lt;/i&gt;year&lt;/a&gt; % 400 == 0
            puts 'Leap year!'
        elsif &lt;a href="/year" class="user-mention" title="@year"&gt;&lt;i&gt;@&lt;/i&gt;year&lt;/a&gt; % 4 == 0 &amp;amp;&amp;amp; &lt;a href="/year" class="user-mention" title="@year"&gt;&lt;i&gt;@&lt;/i&gt;year&lt;/a&gt; % 100 != 0
            puts 'Leap year!'
        else
            puts 'Not a leap year'
        end
    end
end&lt;/p&gt;

&lt;p&gt;leap = Leap_year.new
testyear=gets.chomp.to_i
leap.leap_year?(testyear)&lt;/p&gt;

&lt;p&gt;报错信息：
leap_year.rb:18: private method `chomp' called for nil:NilClass (NoMethodError)
Please input a year:
初步怀疑是这里的问题 testyear=gets.chomp.to_i，但是不明白是什么问题，请大牛们指点指点。&lt;/p&gt;</description>
      <author>miqiu1987</author>
      <pubDate>Tue, 06 Aug 2013 20:25:38 +0800</pubDate>
      <link>https://ruby-china.org/topics/13111</link>
      <guid>https://ruby-china.org/topics/13111</guid>
    </item>
  </channel>
</rss>
