문제

I'm reading an eBook for EXTREME beginners in Ruby. It's walking me through VERY step-by-step, but I want to make sure I'm doing it right before I move on.

My first problem was when I typed irb. Instead of getting irb(main):001:0> like I was supposed to, I just got >>. I finally found how to change my prompt format to inf-ruby.

NOW, I'm worried about missing the other prefixes on each line. There are no resulting =>s or >s. Can someone explain to me (very simply) how to "turn those on" so that I can compare my code exactly to my book?

Thank you so much.

(I'm on Mac OS X 1.7, Ruby 1.8.7, using terminal)

도움이 되었습니까?

해결책

try

irb --prompt default

or

irb --prompt inf-ruby --readline

or this after irb starts

conf.prompt_c="%N(%m):%03n:%i* "
conf.prompt_i="%N(%m):%03n:%i> "
conf.prompt_mode=:DEFAULT
conf.prompt_n="%N(%m):%03n:%i> "
conf.prompt_s="%N(%m):%03n:%i%l "

also check irb --help it has some great help use that :)

다른 팁

Did you run irb --prompt simple?

This explains:
http://tagaholic.me/2009/05/29/exploring-how-to-configure-irb.html#prompt

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top