views:

31

answers:

0

Hi

I'm getting an odd LocalJumpError which only occurs when I'm in staging or production on Ubuntu. When I'm in development environment and passing the same data to the method, I don't get the error. The error is being returned when I attempt to pass data to the following method:

def standard_deviation_percentage(population)
    return nil if population.empty?
    count = population.size
    mean = population.inject(:+) / count.to_f
    return ((Math.sqrt( population.inject(0) { |sum, e| sum + (e - mean) ** 2 } / count.to_f ))/mean)*100
end

Can anybody suggest where I am going wrong?

Thanks