Rails Rails 部署后不能启动问题定位方法

caiqinghua · 2015年11月10日 · 最后由 xiaoronglv 回复于 2015年11月11日 · 2391 次阅读

最近部署 rails 项目,遇到多起部署后不能访问的问题,记录一下排查方法

  1. 查看 nginx 日志

    tail -f -n 2000 /var/log/nginx/error.log
    tail -f -n 2000 /var/log/nginx/access.log
    
  2. 查看 unicorn 日志

    tail -f -n 2000 path/to/current_project/log/unicorn.log
    
    E, [2015-11-09T23:29:51.154676 #18211] ERROR -- : app error: Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml` (RuntimeError)
    
  3. 查看 sidekiq 日志

    `tail -f -n 2000 path/to/current_project/log/sidekiq.log
    
  4. 查看 rails 运行日志

    tail -f -n 2000 path/to/current_project/log/production.log
    

Missing secret_token and secret_key_base for 'production' environment, set these values in config/secrets.yml (RuntimeError)

修改 secrets.yml 下的 production 里 secret_key_base 的值 或者写环境变量

错误信息不是很明显了吗?

帮你排个版 😄

  1. list 中有段落时,要缩进四个空格。

  2. 代码请高亮

需要 登录 后方可回复, 如果你还没有账号请 注册新账号