Search code examples
ruby-on-railsdevisemina

Mina and Devise.secret_key was not set


I'm trying to deploy my app with mina. When it starts to run migrations I got this error:

-----> Migrating database
rake aborted!
Devise.secret_key was not set. Please add the following to your Devise initializer:

  config.secret_key = 'key here.......'

Please ensure you restarted your application after installing Devise or setting the key.
.........

In my devise initializer I have config.secret_key = ENV["SECRET_KEY_BASE"]

How to add this key to my app? Are secret_key_base and secret_key different?

This might be stupid but I dont know how to add this key.

Locally everything works fine

ps I'm using figaro


Solution

  • I added

    set :shared_paths, ['config/database.yml', 'log', 'config/secrets.yml']
    

    to my deploy.rb and it solved my problem.

    In the secrets.yml I set DEVISE_SECRET