I'm trying to deploy my Rails app to my Digital Ocean VPS. I've done all the steps in the GoRails guide but when I deploy my project and visit my ip adres I'm greeted by a message:
An error occurred.
Sorry, the page you are looking for is currently unavailable.
Please try again later.
If you are the system administrator of this resource then you should check the error log for details.
Faithfully yours, nginx.
I've checked the nginx error log which shows me:
Exception RuntimeError in Rack application object (Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`) (process 2490, thread 0x007fbd33665ce0(Worker 1)):
On the VPS I've created a secret by running rake secret
and then running export SECRET_KEY_BASE= + key
. Now when I echo $SECRET_KEY_BASE
it shows me my key. But still I'm getting the error message.
In my deploy.rb
I have this:
set :linked_files, %w{config/database.yml config/secrets.yml}
And my secrets.yml
on the VPS is this:
development:
secret_key_base: 89dacb16fd905ff4c6352ac93f4676a5dd&^%3f93edce9a5be796712d54b57b91e1335598fd73e3998fddbbdeaf3ee7f65157f2fb01ce1bea5658aa7bf745d1f
test:
secret_key_base: cf351585b2cb43459f5a073cbfd885b3dd2af44124f13a855522f678c1cf06625c121cd3b7857&&6e7fe2ba11180066753142143231c79c513e71e20372a0462
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
I just restarted nginx, but still no result.
Update
deploy@movieseat:~$ ps aux | grep nginx
root 4545 0.0 0.6 98936 3360 ? Ss 11:32 0:00 nginx: master process /usr/sbin/nginx
www-data 4548 0.0 0.9 99304 4608 ? S 11:32 0:00 nginx: worker process
www-data 4549 0.0 0.9 99304 4608 ? S 11:32 0:00 nginx: worker process
www-data 4550 0.0 0.9 99304 4608 ? S 11:32 0:00 nginx: worker process
www-data 4551 0.0 0.9 99304 4608 ? S 11:32 0:00 nginx: worker process
deploy 4655 0.0 0.3 9436 1660 pts/1 S+ 11:33 0:00 grep --color=auto nginx