내 Rails 앱을 내 Digital Ocean VPS에 배포하려고합니다. 나는 GoRails guide의 모든 단계를 완료했지만 나는 내 IP ADRES을 내 프로젝트를 배포하고 방문 할 때 나는 메시지로 인사 해요 : 나는 나를 보여 Nginx에 오류 로그를 확인했습니다배포 된 레일에 비밀 키가 누락되었습니다
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.
:
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)):
VPS에서 rake secret
을 실행 한 다음 export SECRET_KEY_BASE= + key
을 실행하여 비밀을 만들었습니다. 이제 echo $SECRET_KEY_BASE
때 내 키를 보여줍니다. 하지만 여전히 오류 메시지가 나타납니다.
set :linked_files, %w{config/database.yml config/secrets.yml}
그리고 VPS 내 secrets.yml
은 이것이다 : 내 deploy.rb
에서
내가 이것을 가지고
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"] %>
난 그냥 여전히 결과를 nginx를 다시 시작,하지만.
업데이트
[email protected]:~$ 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
'SECRET_KEY_BASE'가 nginx 및 passenger와 동일한 사용자에 대해 설정되어 있는지 확인하십시오. – blelump
어떻게 확인할 수 있습니까? 'ssh deploy @ ***. **. ***. **'을 사용하여 로그인 한 다음 모든 명령을 실행합니다. 또한 해당 사용자로 nginx를 다시 시작했습니다. 그래서 nginx 및 승객 배포 사용자에서 실행되는 것 같아요. –
출력이 표시되지 않습니다. 'deploy @ movieseat : ~ $ ls -la | grep nginx deploy @ movieseat : ~ $' –