【问题标题】:Rails-Thin server stopped on Production(live) mode.Website downRails-Thin 服务器在生产(实时)模式下停止。网站关闭
【发布时间】:2014-07-27 09:27:53
【问题描述】:

我已将我的 ruby​​ on rails 项目置于生产模式。我在生产模式下运行瘦服务器。现在瘦服务器似乎突然停止并在尝试启动时出现以下错误:-

/home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/daemonizing.rb:158:in `delete': Read-only file system - tmp/pids/thin.3000.pid (Errno::EROFS)

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/daemonizing.rb:158:in `remove_pid_file'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/daemonizing.rb:175:in `remove_stale_pid_file'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/daemonizing.rb:43:in `daemonize'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/controllers/controller.rb:62:in `start'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/bin/thin:23:in `load'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/bin/thin:23:in `<main>'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/bin/ruby_executable_hooks:15:in `eval'

        from /home/webuser/.rvm/gems/ruby-1.9.3-p545@woa/bin/ruby_executable_hooks:15:in `<main>'

我尝试使用 $ lsof -wni tcp:3000.. 删除 pid,但没有得到任何输出。 还通过了 filezilla 并尝试从 temp 中删除 pid,但出现以下错误。General failure (server should provide error description)

现在我的网站关闭了一个小时,请帮助我解决这个问题

【问题讨论】:

    标签: ruby-on-rails ruby ubuntu production-environment thin


    【解决方案1】:

    直接错误是您的程序无法删除旧的 pid 文件。您计算机上运行的每个进程都有一个与之关联的数字;服务器经常将这个数字保存到一个文件中,以阻止两个同时运行。

    但是,您收到的错误消息 - “只读文件系统” - 很少是一个好兆头。如果您的计算机遇到硬盘驱动器问题,它可能会将文件系统重新安装为只读,以防止进一步损坏。 dmesg 的输出可能会让您了解这里是否是这种情况。您可能可以通过重新启动服务器来恢复并运行服务器,但您需要注意即将发生的硬盘故障。

    【讨论】:

    • @alex-p..感谢您的解决方案..但是如何将文件的权限更改为 777..任何想法
    • 如果文件系统是只读的,您不能更改权限。权限涉及文件系统写入,因此您必须先修复它。
    • @alex-p ..所以解决这个问题的唯一方法是重新启动服务器。我的 nginx 也出现了同样的问题。所以我应该继续重新启动服务器。它在天蓝色
    • 重启服务器是最简单的。 Nginx 给你同样的错误,因为它试图写入同一个文件系统。
    • @alex-p..非常感谢队友..我的网站已经启动并正在运行..但是想了解一下为什么会发生这种情况。我应该在哪里检查它
    猜你喜欢
    • 2012-10-11
    • 1970-01-01
    • 2021-12-04
    • 2016-03-12
    • 2021-03-27
    • 1970-01-01
    • 2011-12-12
    • 1970-01-01
    • 2022-08-18
    相关资源
    最近更新 更多