我在运行一个 rb 之后,CTRL+C to stop,重新修改了同一个 rb 文件,然后再 ruby xx.rb
ruby app_get.rb
== Sinatra/1.4.5 has taken the stage on 4567 for development with backup from Thin
Thin web server (v1.6.3 codename Protein Powder)
Maximum connections set to 1024
Listening on localhost:4567, CTRL+C to stop
Stopping ...
== Sinatra has ended his set (crowd applauds)
/Users/melody/.rvm/gems/ruby-2.1.3/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 /Users/melody/.rvm/gems/ruby-2.1.3/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in
start_server'
from /Users/melody/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/backends/tcp_server.rb:16:in connect'
from /Users/melody/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/backends/base.rb:63:in
block in start'
from /Users/melody/.rvm/gems/ruby-2.1.3/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in call'
from /Users/melody/.rvm/gems/ruby-2.1.3/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in
run_machine'
from /Users/melody/.rvm/gems/ruby-2.1.3/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in run'
from /Users/melody/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/backends/base.rb:73:in
start'
from /Users/melody/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/server.rb:162:in start'
from /Users/melody/.rvm/gems/ruby-2.1.3/gems/rack-1.6.0.beta/lib/rack/handler/thin.rb:19:in
run'
from /Users/melody/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1497:in start_server'
from /Users/melody/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1435:in
run!'
from /Users/melody/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/main.rb:25:in `block in module:Sinatra'
总是会遇到,如何解决?? 还有我能不能一直 start Thin 服务,修改 rb 文件后,不再需要先 Stop 在 Star 服务,而是直接刷新下,就可以测试我文件修改是否正确???