What is the best way to generate a random number in Ruby?

What is the best way to generate a random number in Ruby?

How can I create a random number between 0 and n in Ruby? What methods are available for Ruby random number generation, and which one is the most efficient?