gpt4 book ai didi

ruby - Shotgun Gem 的问题 - RuntimeError

转载 作者:数据小太阳 更新时间:2023-10-29 08:32:35 26 4
gpt4 key购买 nike

当我尝试使用 shotgun 运行简单的 ruby​​ 应用程序时出现此错误:

    Jons-MacBook-Pro:sin jonread$ shotgun simple.rb
== Shotgun/Thin on http://127.0.0.1:9393/
>> Thin web server (v1.5.0 codename Knife)
>> Maximum connections set to 1024
>> Listening on 127.0.0.1:9393, CTRL+C to stop
/Users/jonread/.rvm/gems/ruby-2.0.0-p195/gems/eventmachine-1.0.0/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/gems/eventmachine-1.0.0/lib/eventmachine.rb:526:in `start_server'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/gems/thin-1.5.0/lib/thin/backends/tcp_server.rb:16:in `connect'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/gems/thin-1.5.0/lib/thin/backends/base.rb:55:in `block in start'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `call'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run_machine'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/gems/thin-1.5.0/lib/thin/backends/base.rb:63:in `start'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/gems/thin-1.5.0/lib/thin/server.rb:159:in `start'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in `run'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/gems/shotgun- 0.9/bin/shotgun:156:in `<top (required)>'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/bin/shotgun:23:in `load'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/bin/shotgun:23:in `<main>'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/jonread/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `<main>'

关于发生这种情况的原因或快速解决方法的任何想法?

最佳答案

Josh Voigt 在评论中的回答对我有用。

macbook:cpaphires johnnygoodman$ lsof -i tcp:3000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ruby 24976 johnnygoodman 8u IPv4 0xffffff8020b71fa0 0t0 TCP *:hbci (LISTEN)
macbook:cpaphires johnnygoodman$ kill -9 24976
macbook:cpaphires johnnygoodman$ lsof -i tcp:3000
macbook:cpaphires johnnygoodman$ rails s
=> Booting Thin
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop

修复了这个错误:

Listening on 0.0.0.0:3000, CTRL+C to stop Exiting /usr/local/rvm/gems/ruby-1.9.3-p392/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in
start_server' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.1/lib/thin/backends/tcp_server.rb:16:in connect'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.1/lib/thin/backends/base.rb:55:in
block in start' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in call'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in
run_machine' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in run'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.1/lib/thin/backends/base.rb:63:in
start' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.1/lib/thin/server.rb:159:in start'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/handler/thin.rb:13:in
run' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:268:in start'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in
start' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.11/lib/rails/commands.rb:55:in block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.11/lib/rails/commands.rb:50:in
tap' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.11/lib/rails/commands.rb:50:in <top (required)>'
from script/rails:6:in
require' from script/rails:6:in `'

关于ruby - Shotgun Gem 的问题 - RuntimeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17321030/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com