Basically this:
1.9.3p0 :024 > 2.day + Date.today
Gives an error:
TypeError: Date can't be coerced into Fixnum
Can anyone explain why this is hapenning and how to add 2 days/months to a current day
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to turn it around.
Followup
2.daysreturns aFixnum, which has a.+()method, which expects another numeric type, of whichDateis not.Datehas a.+()method that acceptsFixnumand other numeric types.