I deployed a Rails 4 app ( using .rbenv ) to a remote Ubuntu server running Ngninx + Unicorn using Capistrano ( staging deployment)
E, [2015-08-10T16:53:29.822778 #24117] ERROR -- : app error: Missing `secret_token` and `secret_key_base` for 'staging' environment, set these values in `config/secrets.yml` (RuntimeError)
Using the capistrano/upload-config , I link the secrets.yml file on the remote server in the current release deployed
app/config/
secrets.staging.yml
secrets.yml -> /var/www/rails/delayMessage/shared/config/secrets.yml
and the /var/www/rails/delayMessage/shared/config/secrets.yml file contains
staging:
secret_key_base: 10c7ed6bccc6d3acb71...
Why is the secret_key_base NOT taken into account, and why is this error raised and displayed in the unicorn.stderr.log
UPDATE 1
in unicorn.rb I have the following paths (app and shared ) set ... maybe they are wrong
# Set your full path to application. app_dir = File.expand_path('../../', FILE) shared_dir = File.expand_path('../../../shared/', FILE)
secrets.staging.yml
? is it another file inapp/config
– bigsolomcurrent
atreleases/[timestamp]
, Unicorn might be pointing at an old version. Alternately, make sure that Unicorn is being restarted after the symlink change so it sees the file (I'd imagine that this is happening correctly). – will_in_wi