2013-01-16 19 views
0

我正在使用Windows機器,並使用Ruby 1.9.3和Rails 3.2,並且只安裝了Devise gem進行身份驗證。哪裏可以替代Devise代碼中的「SecureRandom」的「ActiveSupport :: SecureRandom」?

當我嘗試與先前註冊的用戶登錄時,出現以下錯誤:

NameError in Devise::SessionsController#create 

uninitialized constant ActiveSupport::SecureRandom 

周圍的Googling,我讀過,這是由於「的ActiveSupport」中的Rails 3.2被棄用,並該解決方案是將代碼中的「ActiveSupport:SecureRandom」的每個外觀替換爲「SecureRandom」。

我一直在尋找該字符串的代碼(「ActiveSupport:SecureRandom」),但一直未能找到它。它在哪裏?在哪個文件中?

回答

0

你可以把這段代碼在頂部devise.rb

ActiveSupport::SecureRandom = SecureRandom 

對我的作品