Devise Secret Key was not set

前端 未结 16 1266
别那么骄傲
别那么骄傲 2020-11-27 14:53

I am developing a Rails 4 app using the Active Admin gem for the administration back end. Active Admin in turn uses Devise for user authentication. Now, when I try to deploy

16条回答
  •  忘掉有多难
    2020-11-27 15:33

    As per changelog:

    Devise will use the secret_key_base on Rails 4+ applications as its secret_key. You can change this and use your own secret by changing the devise.rb initializer.

    I went to config/secrets.yml and changed the production value.

    Before:

    production: 
      secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
    

    After:

    production: 
      secret_key_base: string of charaters
    

    Of course, that should be set to the environment variable, which I will set later, but this at least got it running. I got my string by using bundle exec rake secret.

提交回复
热议问题