我有一个 Ruby 程序:
k = ARGV[0]
j = ARGV[1]
def random_tuple(length)
letters_and_numbers = "0123456789"
answer = ""
length.times { |i| answer << letters_and_numbers[rand(10)] }
answer
end
j.times { |i| Product.create number:random_tuple(8) }
该代码接受一个参数并生成该 mcuh 随机数,但我得到一个错误,任何人都可以建议我错在哪里。