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

caiqinghua · November 10, 2015 · Last by xiaoronglv replied at November 11, 2015 · 2391 hits

最近部署 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. 代码请高亮

You need to Sign in before reply, if you don't have an account, please Sign up first.