Devise Secret Key was not set

前端 未结 16 1287
别那么骄傲
别那么骄傲 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:37

    Trying to give a somewhat more complete answer to the ones above: As mentioned in the devise_auth_token gem's documentation

    ...Additionally, you can configure other aspects of devise by manually creating the traditional devise.rb file at config/initializers/devise.rb. Here are some examples of what you can do in this file:

    Devise.setup do |config|   
    # The e-mail address that mail will appear to be sent from   
    # If absent, mail is sent from "please-change-me-at-config-initializers-devise@example.com"  
    config.mailer_sender = "support@myapp.com"
    
    # If using rails-api, you may want to tell devise to not use ActionDispatch::Flash   
    # middleware b/c rails-api does not include it.   
    # See: http://stackoverflow.com/q/19600905/806956  
    config.navigational_formats = [:json] end
    

    I had the same problem, and like metioned here, I created the devise initializer, and add the config.secret_key = ENV['DEVISE_SECRET_KEY'] line to it.

提交回复
热议问题