씬 웹 서버 :`start_tcp_server ': 자식 브랜치 체크 아웃 후 수락 자 (RuntimeError)
로컬 및 Heroku 삼나무 스택 모두에서 Thin 웹 서버와 잘 작동하는 Rails 3.2.0 앱.
후:
$ git branch work
$ git checkout work
$ rails server
나는 얻다:
=> Booting Thin
=> Rails 3.2.0 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.3.1 codename Triple Espresso)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop
Exiting
/Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_tcp_server': no acceptor (RuntimeError)
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_server'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb:16:in `connect'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/thin-1.3.1/lib/thin/backends/base.rb:53:in `block in start'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `call'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/thin-1.3.1/lib/thin/server.rb:159:in `start'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler/thin.rb:13:in `run'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.0/lib/rails/commands/server.rb:70:in `start'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.0/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.0/lib/rails/commands.rb:50:in `tap'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.0/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
또한 내가 할 때 :
sudo bundle exec rails server thin -p 3000
나는 얻다:
/Users/peter/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
from /Users/peter/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/peter/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in `gem'
from /Users/peter/.rvm/gems/ruby-1.9.3-p125/bin/bundle:18:in `<main>'
번 들러 1.0.22가 설치되어 있습니다. 업데이트하고 설치했습니다. 아무것도 작동하지 않는 것 같습니다. 어떤 아이디어?
이것은 나를 위해 작동합니다. (좀비?) 서버 찾기 (서버가 실행중인 터미널을 종료 할 때 발생할 수 있음) :
$ ps ax | grep rails
그것이 다음과 같은 것을 반환하면 :
33467 s002 S+ 0:00.00 grep rails
33240 s003 S+ 0:15.05 /Users/Arta/.rbenv/versions/1.9.2-p290/bin/ruby script/rails s -p 3000
그것을 죽이고 새로 실행하십시오.
$ kill -9 33240
$ rails s
포트 3000이 이미 사용 중일 수 있습니다. http://mrjaba.posterous.com/starttcpserver-no-acceptor-runtimeerror를 보십시오
pgrep ruby
어떤 서버가 실행 중인지 확인한 다음
kill -9 serverNumber
;)
포트를 잠그는 다른 프로세스가 있으면 다음과 같은 PID를 찾을 수 있습니다.
$ lsof -i :3000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Passenger 40466 josh 5u IPv4 0x7cae9332073ed4df 0t0 TCP *:hbci (LISTEN)
Passenger 40467 josh 5u IPv4 0x7cae9332073ed4df 0t0 TCP *:hbci (LISTEN)
그런 다음 간단히 죽여라 :
$ kill -9 40466
$ kill -9 40467
rvmsudo rails 서버 thin -p 3000
나를 위해합니까
I has this error because i was running rails-dev-box with Rails inside of it.
Port 3000 in the host computer is forwarded to port 3000 in the virtual machine.
Thus, applications running in the virtual machine can be accessed via
localhost:3000 in the host computer.
So is logged out from Vagrant and shutted down it:
vagrant@rails-dev-box:/vagrant/rails$ exit
$ vagrant halt
That helped me.
I had this error because I was already running rails in another terminal. Closing my other project fixed this.
I ran into a similar issue after getting back to the office from vacation. I run my server on the local IP as:
rails s thin -b <my_ip>
The problem was that my IP had changed, I just needed to use the new one.
Execute this in the terminal
sudo netstat -lpn |grep rails
And then
sudo kill <job id>
'Programming' 카테고리의 다른 글
이미 사용중인 주소-bind (2) (Errno :: EADDRINUSE) (0) | 2020.07.29 |
---|---|
PHP "if"문에 HTML을 포함시킬 수 있습니까? (0) | 2020.07.29 |
`textField : shouldChangeCharactersInRange :`를 사용하여 현재 입력 된 문자를 포함한 텍스트를 어떻게 얻습니까? (0) | 2020.07.29 |
PHP에서 유닉스 타임 스탬프에 24 시간을 어떻게 추가합니까? (0) | 2020.07.29 |
이 달의 이름 (이름으로 날짜-오늘. 달) (0) | 2020.07.29 |