Active support key generator, where is it?

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 -- active_support/key_generator

Finally, a Google search does not yield any relevant results. Lez.

Has anyone used KeyGenerator before? How to get it?

+4
source share
1 answer

It exists since rails 4.0.0

0
source

All Articles