Я пытаюсь получить текущую версию ruby от IRB, но она выдаёт мне эту ошибку:
>> RUBY_VERSION
NoMethodError: undefined method `write' for nil:NilClass
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `printf'
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `output_value'
from /usr/local/lib/ruby/1.9.1/irb.rb:160:in `block (2 levels) in eval_input'
from /usr/local/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
from /usr/local/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
from /usr/local/lib/ruby/1.9.1/irb/ext/multi-irb.rb:166:in `block (2 levels) in irb'
from /usr/local/lib/ruby/1.9.1/irb/ext/multi-irb.rb:165:in `catch'
from /usr/local/lib/ruby/1.9.1/irb/ext/multi-irb.rb:165:in `block in irb'
Maybe IRB bug!
ruby -v
показывает ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
Я использую Mac OS X Lion
ОБНОВЛЕНИЕ: На самом деле, оно вообще ничего не запускает.
>> a = 'Hello, World!'
NoMethodError: undefined method `write' for nil:NilClass
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `printf'
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `output_value'
from /usr/local/lib/ruby/1.9.1/irb.rb:160:in `block (2 levels) in eval_input'
from /usr/local/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
from /usr/local/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
from /usr/local/lib/ruby/1.9.1/irb/ext/multi-irb.rb:166:in `block (2 levels) in irb'
from /usr/local/lib/ruby/1.9.1/irb/ext/multi-irb.rb:165:in `catch'
from /usr/local/lib/ruby/1.9.1/irb/ext/multi-irb.rb:165:in `block in irb'
Maybe IRB bug!
ОБНОВЛЕНИЕ № 2: (для жестянщика) Использование/ usr / bin / irb, я получаю
>> 5+5
NoMethodError: undefined method `write' for nil:NilClass
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:310:in `printf'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:310:in `output_value'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:159:in `eval_input'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:271:in `signal_status'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:155:in `eval_input'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb/ruby-lex.rb:244:in `each_top_level_statement'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb/ruby-lex.rb:230:in `loop'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb/ruby-lex.rb:230:in `each_top_level_statement'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb/ruby-lex.rb:229:in `catch'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb/ruby-lex.rb:229:in `each_top_level_statement'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:154:in `eval_input'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:71:in `start'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:70:in `catch'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:70:in `start'
from /usr/bin/irb:13
Maybe IRB bug!!