Skip to content

Instantly share code, notes, and snippets.

@javiertoledo
Created July 17, 2012 10:13
Show Gist options
  • Save javiertoledo/3128574 to your computer and use it in GitHub Desktop.
Save javiertoledo/3128574 to your computer and use it in GitHub Desktop.
Hack to avoid gem compatibility nightmare
# If you're having this exception in Rails >=3.2.X, on Ruby >1.9.X..
#
# uninitialized constant ActiveSupport::SecureRandom
#
# ..and you don't want to debug half dozen of gems until you
# find which one is causing the error, you can use this hack
# as Ruby's SecureRandom API is 100% compatible with the
# Rails <3.2 ActiveSupport::SecureRandom API.
#
# This is absolute uglyness, but works and I wont tell nobody
# that you are so lazy you used it ;-)
ActiveSupport::SecureRandom = SecureRandom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment