【问题标题】:Where is my Rails log file after deployed to VPS using Capistrano使用 Capistrano 部署到 VPS 后,我的 Rails 日志文件在哪里
【发布时间】:2014-11-16 08:45:47
【问题描述】:

我已使用 Capistrano 3 将我的 Rails 应用程序部署到 VPS(Nginx + Unicorn + Postgres),但出现错误页面“我们很抱歉,但出了点问题”。而且我找不到我的 Rails 日志文件,我在 deploy.rb 中取消了对这一行的注释,仍然找不到。

set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

在我的当前/log 目录和 shared/log/ 中有日志文件,但是当我刷新我的错误页面时它们没有得到更新。

有什么想法吗?

谢谢

【问题讨论】:

  • 你的 unicorn.rb 文件中有 stderr_path "#{root}/shared/log/unicorn.log"stdout_path "#{root}/shared/log/unicorn.log" 吗?
  • 是的,root = "/var/www/projectx/current" stderr_path "#{root}/log/unicorn.log" stdout_path "#{root}/log/unicorn.log"跨度>
  • tail -n 100 /var/www/projectx/current/log/unicorn.log 什么也不返回?
  • 我的当前/日志目录中没有 unicorn.log 文件。仅(development.log newrelic_agent.log staging.log)

标签: ruby-on-rails vps


【解决方案1】:

尝试执行以下操作:

  1. touch /var/www/projectx/shared/log/unicorn.log
  2. 更新您的 unicorn.rb 文件:

    stderr_path "#{root}/shared/log/unicorn.log"
    stdout_path "#{root}/shared/log/unicorn.log"
    
  3. 重新启动您的独角兽工作人员和主进程。

原因:每次更新存储库时,您的日志文件都会被重置。

【讨论】:

  • 谢谢,如何重启独角兽工作者和主进程?对不起,我是新手 :(
  • 您使用哪个教程进行设置?有几种不同的方法。
  • 当我输入 unicorn_rails -c /var/www/projectx/current/config/unicorn.rb -D 时,我得到 master 无法启动,查看 stderr 日志了解详细信息,我在哪里可以找到 stderr那么登录呢?
  • 对,它说地址已在使用中:),但我在哪里可以找到我的 Rails 应用程序日志..
猜你喜欢
  • 1970-01-01
  • 2013-07-25
  • 2012-09-08
  • 2012-12-20
  • 2014-09-03
  • 1970-01-01
  • 2012-08-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多