From: Matthew Moss Date: 2006-03-22T08:10:48+09:00 Subject: Re: Newbie: Printing hex formatted string using printf > Why does printf act like a private method here? printf is not a method on Fixnum. The error is confusing (except that the first word is "NoMethodError"). If you want to use printf, just do: $stderr.printf "Magic number is: %X\n", magic_number Or, more ruby-ish: puts "Magic number is: #{magic_number.to_s(16)}"