Secure Random passwords in Ruby

You would like to use a random password in ruby. Most solutions describe using the Digest library (Digest::SHA1).

According to the post here, you can achieve the same by using ActiveSupport’s secure_random library.
To use it in Ruby outside Rails use:

and inside rails: