You have the code set to skip variable assignment for your numb_X variables.
So when the print command:
puts var_m * numb_m + var_d * numb_d + var_c * numb_c + var_l * numb_l + var_x * numb_x + var_v * numb_v + var_i * numb_i
is reached you wind up with nil values in the variables.
This happens for any numbers that evaluate to 0 before reaching the last if statement (5,10,20,...50,100,...).
a simple way to correct this is it to add an intial assignment for the variables:
numb_i=numb_v=numb_x=numb_l=numb_c=numb_d=numb_m=0
Here is a version I made following the additional set of rules rules at
http://en.wikipedia.org/wiki/Roman_numerals.
Code:
def ronum n
d=[3000,2000,1000,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1]
r=["MMM","MM","M","CM","DCCC","DCC","DC","D","CD","CCC","CC","C","XC","LXXX","LXX","LX","L","XL","XXX","XX","X","IX","VIII","VII","VI","V","IV","III","II","I"]
rs=""
d.each_with_index {|i,j|
if n.to_i >= d[j]
rs+=r[j]
n=n.to_i-d[j]
end
}
rs
end
puts ronum ARGV.pop
Use (if saved as ronum.rb):
>ronum 1984
result:
MCMLXXXIV