【问题标题】:Thin Restart error精简重启错误
【发布时间】:2014-04-25 19:17:37
【问题描述】:

您好,我正在修复 Rails Web 服务器上的 ruby​​,但遇到了 Thin gem 问题。我看着这里并寻求帮助,但很快就迷路了,我想知道这里是否有人知道我的宝石出了什么问题。运行“thin restart -s 2”后出现的错误是:

/usr/local/rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/daemonizing.rb:129:in `send_signal': Can't stop process, no PID found in tmp/pids/thin.3001.pid (Thin::PidFileNotFound)

    from /usr/local/rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/daemonizing.rb:111:in `kill'

    from /usr/local/rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:94:in `block in stop'

    from /usr/local/rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:135:in `tail_log'

    from /usr/local/rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:93:in `stop'

    from /usr/local/rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:199:in 'run_command'

    from /usr/local/rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'

    from /usr/local/rvm/gems/ruby-2.1.1/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'

    from /usr/local/rvm/gems/ruby-2.1.1/bin/thin:23:in `load'

    from /usr/local/rvm/gems/ruby-2.1.1/bin/thin:23:in `<main>'

    from /usr/local/rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'

    from /usr/local/rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

这是我第一次使用锡宝石,我只能猜出哪里出了问题。我会继续寻找并感谢任何知道问题所在的人。

【问题讨论】:

  • ps -ef | grep thinkill 全部过程并重新开始。
  • 并给kill -9 PID杀死所有进程。重新启动它。
  • 我得到:ps -ef | grep 细根 25436 25291 0 16:45 pts/3 00:00:00 grep --color=auto thin
  • 我试图杀死 -9 PID 25436 但我不知道我是否做得对,我会继续努力谢谢!

标签: ruby-on-rails thin


【解决方案1】:

我有同样的问题。从thin start 开始解决这个问题。

thin restart 基本上是指thin stop &amp;&amp; thin start。在我的情况下,thin stop 返回了一个错误,因为 Thin 没有运行,因此无法停止。

【讨论】:

  • 当我只运行“thin start”时,我收到此错误:::/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/ runtime.rb:34:in block in setup': You have already activated rack 1.5.2, but your Gemfile requires rack 1.4.5. Prepending bundle exec` 到你的命令可以解决这个问题。 (Gem::LoadError)
  • 添加 bundle exec 会在我的终端上启动我的服务器,我需要我的服务器在 ssh 上运行,以便该站点始终处于活动状态。我会坚持下去=D,感谢 Bonifacio2!我们很亲密,我知道;)
  • 你试过bundle exec thin start吗?
  • 是的,这就是我在我的 cmets 中所说的。对不起,我不清楚。
【解决方案2】:

我遇到了同样的问题,但不明白为什么它在 stoprestart 上失败了(开始工作)。 我想看看我的远程current/tmp 文件夹,看看它是否包含pids/ 文件夹。它不见了。所以服务器可以启动,但不能因为pid丢失而停止。

有时它会丢失,因为您的 .gitignore 包含 tmp/*
现在我有:

tmp/cache/*
tmp/data/*
tmp/pids/*
tmp/sessions/*
tmp/sockets/*

文件夹存在,所以PID文件可以写、读、删除。

请注意,如果您使用 Capistrano,则必须确保 tmp/pids 已符号链接到共享文件夹。
否则,cap 会在一个版本的开始时写入一个 pid,并会尝试在另一个版本中找到这些 pid,除非你有正确的符号链接:

## Capistrano 3 - deploy.rb
set :linked_dirs, %w{bin log tmp/backup tmp/pids tmp/cache tmp/sockets vendor/bundle}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-13
    • 2012-02-08
    • 1970-01-01
    • 1970-01-01
    • 2011-07-15
    相关资源
    最近更新 更多