Trying to get uuidtools working


This is a potentially obvious problem. I’m trying to generate a uuid in
one of my models. I poked around and found the uuidtools gem (is there a
better way to generate a uuid?). Here’s the code I’m currently using:

require ‘rubygems’
require ‘uuidtools’

class Subscription < ActiveRecord::Base

def initialize
self.guid UUID.timestamp_create.to_s

It seems straight-forward, but I keep getting this error:

“no such file to load – uuidtools”

I installed the gem previously using “gem install uuidtools” and it
seemed to be successful. What am I missing?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs