1
irb에서 Date.today를 시도하고 있는데 실패합니다.왜 Date.today가 Ruby 콘솔 (irb)에서 작동하지 않습니까?
나는 원래 일을하려고했다 :
Date.today.strftime "%b %d, '%y"
irb에서 Date.today를 시도하고 있는데 실패합니다.왜 Date.today가 Ruby 콘솔 (irb)에서 작동하지 않습니까?
나는 원래 일을하려고했다 :
Date.today.strftime "%b %d, '%y"
어떻게 실패 하는가? 이런 식으로 실패합니까?
phrogz$ irb
> Date.today
NameError: uninitialized constant Object::Date
from (irb):1
from /usr/local/bin/irb:12:in `<main>'
> require 'date'
#=> true
> Date.today
#=> #<Date: 2010-12-05 (4911071/2,0,2299161)>
그렇다면 대답이 있습니다. (그렇지 않은 경우 provide more details이 앞으로 진행됩니다.)