Finally, I resolved this!
Steps:
- Install libreadline5 and libreadline5-dev, depends on libncurses5
- download ruby source code: ruby_1_8
- cd (ruby_src_dir)/ext/readline
- ruby extconf.rb
- make
- sudo make install
Done! Enjoy ruby!
def test
if object.respond_to? "guagua" && object.respond_to? "walk"
#object is almost a duck!
end
end