Last Updated: February 25, 2016
·
1.076K
· joshkerr

Create UUID's in Ruby with a few simple commands

Make sure you have the uuid gem installed:

gem install uuid

Then just do this:

require 'uuid'
uuid = UUID.new
uuid_string = uuid.generate

Now you've got a string with a UUID in it. There are a lot more options available in this library so you should read up on the documentation.