puts "Hello! Reading temperature value from data file..."
num = File.read("temp.dat")
puts "The number is #{num}..."
celsius = num.to_i
fahrenheit = (celsius.to_i * 9/5) + 32
puts "The Fahrenheit value is: #{ fahrenheit }."
#{num}
블록 다음의 ...
줄이 새 줄에 인쇄됩니다. 나는 그 블록을 사용하는 것이 더 쉬운 포맷팅을 허용하는 매개 변수를 디스플레이에 전달한다는 인상을 받았다.왜 세 줄이 새 줄에 쓰여 있습니까?
왜 점들이 줄 바꿈됩니까?
파일'temp.dat'에 끝에 NewLine 문자가 포함되어 있기 때문에? – manji
Ruby 디버깅을 처음 접하는 경우 http://stackoverflow.com/questions/3955688/how-do-i-debug-ruby-scripts를 참조하십시오. –