Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined method `secret_key=' for Devise:Module (NoMethodError)

I am using devise with Rails 4. I had a problem with some fields not rendering in the user views and I realised it's because of the attr_accessible that's not supported any more so I had a look around and came to the conclusion I should use the latest version of the gem (3.0.3).

And that's when the problem appeared:

I cannot run any rails commands now as I am getting the undefined method 'secret_key=' for Devise:Module (NoMethodError) error and it's not going away even if I downgrade the gem.

Rolling back to some previous git commit doesn't solve it, remove the gem and doing a bundle install again doesn't solve it, and I starting to think I should probably start from scratch.

Does anyone know how to walk past this?

like image 805
sebkkom Avatar asked Oct 21 '13 20:10

sebkkom


1 Answers

I believe this setting is only available in the more recent versions of Devise, 3.1.x and above. You should either upgrade the gem to this version or remove that line that references secret_key= from your config/initializers/devise.rb file.

like image 96
Ryan Bigg Avatar answered Oct 18 '22 09:10

Ryan Bigg