Re: #1–you want to call either .to_i or .to_f on your now-string
variables. The former converts to integer, the latter to a floating
point number.
Also (and read this next bit w/the voice of the Simpson’s Comic Book Guy
in your head) there is no compiler–ruby is an interpreted language, it
has an interpreter.
-Roy
P.S. That calculation you show looks like it would be better put in a
model.