Using Rails 4.0.1
I am trying to create a key to use with ActiveSupport::MessageEncryptor, but I cannot find how to require key_generator. I follow this code: http://api.rubyonrails.org/classes/ActiveSupport/MessageEncryptor.html
This code throws an error:
key = ActiveSupport::KeyGenerator.new('password').generate_key(salt)
NameError: uninitialized constant ActiveSupport::KeyGenerator
The requirement that it does not work:
require 'active_support/key_generator'
LoadError: cannot load such file
Finally, a Google search does not yield any relevant results. Lez.
Has anyone used KeyGenerator before? How to get it?
source
share