2

以下を使用して単純な Ruby アプリを実行しようとすると、このエラーが発生しますshotgun

    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>'

なぜこれが起こっているのか、またはそれを修正する簡単な方法についてのアイデアはありますか?

4

1 に答える 1

5

コメントでの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

このエラーを修正したもの:

0.0.0.0:3000 でリッスンし、CTRL+C で停止します 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:instart_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:inblock 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:inrun_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:instart' 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:inrun' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:268:instart' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.11/lib/rails/commands/server.rb:70:instart' 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:intap' 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:inrequire' from script/rails:6:in `'

于 2013-07-04T19:00:13.767 に答える