fttpra
2.996K
· July 2012 ·
Seriousmeh square

Fast solution for 'uninitialized constant ActiveSupport::SecureRandom'

If you're having this exception after updating a Rails application to version >=3.2.X, on Ruby >1.9.X..

uninitialized constant ActiveSupport::SecureRandom

..and you don't want to debug half dozen gems until you
find which one is causing the error, you can use this hack
as Ruby's >1.9 SecureRandom API is 100% compatible with the
Rails <3.2 ActiveSupport::SecureRandom API.

Just add this line in some initializer:

 ActiveSupport::SecureRandom = SecureRandom

This is absolute uglyness, but it works and I won't tell nobody
that you went so lazy to use it ;-)

Sign in or sign up to add your response.
Featured Programming Job

PHP Developer
·
Covent Garden, London, UK
·
Full Time
Search all programming jobs