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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top