我在 OSX 10.10.4 中使用 ruby on rails,并且
每次运行:
bundle exec foreman start
或者
bundle exec rake db:drop db:create db:migrate
或者
rails s
rails 给了我这个错误:
Errno::ECONNREFUSED: Connection refused - send(2)
~.rvm/gems/ruby-2.1.1/gems/ruby-growl-4.1/lib/ruby-growl/udp.rb:166:in `send'
~.rvm/gems/ruby-2.1.1/gems/ruby-growl-4.1/lib/ruby-growl/udp.rb:166:in `send'
~.rvm/gems/ruby-2.1.1/gems/ruby-growl-4.1/lib/ruby-growl/udp.rb:151:in `notify'
~.rvm/gems/ruby-2.1.1/gems/ruby-growl-4.1/lib/ruby-growl.rb:325:in `notify_udp'
~.rvm/gems/ruby-2.1.1/gems/ruby-growl-4.1/lib/ruby-growl.rb:292:in `notify'
~.rvm/gems/ruby-2.1.1/gems/uniform_notifier-1.8.0/lib/uniform_notifier/growl.rb:65:in `notify'
~.rvm/gems/ruby-2.1.1/gems/uniform_notifier-1.8.0/lib/uniform_notifier/growl.rb:33:in `setup_connection_growl'
~.rvm/gems/ruby-2.1.1/gems/uniform_notifier-1.8.0/lib/uniform_notifier/growl.rb:10:in `setup_connection'
~.rvm/gems/ruby-2.1.1/gems/uniform_notifier-1.8.0/lib/uniform_notifier.rb:28:in `growl='
~.rvm/gems/ruby-2.1.1/gems/bullet-4.14.4/lib/bullet.rb:32:in `growl='
~cube/config/environments/development.rb:46:in `block (2 levels) in <top (required)>'
~.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:36:in `call'
~.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
~.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
~.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:44:in `each'
~.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
~.rvm/gems/ruby-2.1.1/gems/railties-4.1.4/lib/rails/application/finisher.rb:64:in `block in <module:Finisher>'
~.rvm/gems/ruby-2.1.1/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `instance_exec'
~.rvm/gems/ruby-2.1.1/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `run'
~.rvm/gems/ruby-2.1.1/gems/railties-4.1.4/lib/rails/initializable.rb:55:in `block in run_initializers'
~.rvm/gems/ruby-2.1.1/gems/railties-4.1.4/lib/rails/initializable.rb:54:in `run_initializers'
~.rvm/gems/ruby-2.1.1/gems/railties-4.1.4/lib/rails/application.rb:300:in `initialize!'
~cube/config/environment.rb:5:in `<top (required)>'
~.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
~.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `block in require'
~.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
~.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
~.rvm/gems/ruby-2.1.1/gems/railties-4.1.4/lib/rails/application.rb:276:in `require_environment!'
~.rvm/gems/ruby-2.1.1/gems/railties-4.1.4/lib/rails/application.rb:379:in `block in run_tasks_blocks'
~.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
~.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
我已经安装了 Growl 2.1.3 并且有时它解决了问题,但 ruby 发送此错误:
MacBook:cube ~$ bundle exec foreman start
22:09:30 web.1 | started with pid 867
22:09:31 web.1 | I, [2015-07-11T22:09:31.934069 #867] INFO -- : Refreshing Gem list
22:09:47 web.1 | E, [2015-07-11T22:09:47.496864 #867] ERROR -- : adding listener failed addr=0.0.0.0:3000 (in use)
22:09:47 web.1 | E, [2015-07-11T22:09:47.496979 #867] ERROR -- : retrying in 0.5 seconds (4 tries left)
22:09:47 web.1 | E, [2015-07-11T22:09:47.999011 #867] ERROR -- : adding listener failed addr=0.0.0.0:3000 (in use)
22:09:47 web.1 | E, [2015-07-11T22:09:47.999143 #867] ERROR -- : retrying in 0.5 seconds (3 tries left)
22:09:48 web.1 | E, [2015-07-11T22:09:48.501288 #867] ERROR -- : adding listener failed addr=0.0.0.0:3000 (in use)
22:09:48 web.1 | E, [2015-07-11T22:09:48.501420 #867] ERROR -- : retrying in 0.5 seconds (2 tries left)
22:09:49 web.1 | E, [2015-07-11T22:09:49.003666 #867] ERROR -- : adding listener failed addr=0.0.0.0:3000 (in use)
22:09:49 web.1 | E, [2015-07-11T22:09:49.003800 #867] ERROR -- : retrying in 0.5 seconds (1 tries left)
22:09:49 web.1 | E, [2015-07-11T22:09:49.504775 #867] ERROR -- : adding listener failed addr=0.0.0.0:3000 (in use)
22:09:49 web.1 | E, [2015-07-11T22:09:49.504953 #867] ERROR -- : retrying in 0.5 seconds (0 tries left)
22:09:50 web.1 | E, [2015-07-11T22:09:50.007006 #867] ERROR -- : adding listener failed addr=0.0.0.0:3000 (in use)
22:09:50 web.1 | /~.rvm/gems/ruby-2.1.1/gems/unicorn-4.8.3/lib/unicorn/socket_helper.rb:185:in `bind': Address already in use - bind(2) for 0.0.0.0:3000 (Errno::EADDRINUSE)
22:09:50 web.1 | from /~.rvm/gems/ruby-2.1.1/gems/unicorn-4.8.3/lib/unicorn/socket_helper.rb:185:in `new_tcp_server'
22:09:50 web.1 | from /~.rvm/gems/ruby-2.1.1/gems/unicorn-4.8.3/lib/unicorn/socket_helper.rb:165:in `bind_listen'
22:09:50 web.1 | from /~.rvm/gems/ruby-2.1.1/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:242:in `listen'
22:09:50 web.1 | from /~.rvm/gems/ruby-2.1.1/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:809:in `block in bind_new_listeners!'
22:09:50 web.1 | from /~.rvm/gems/ruby-2.1.1/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:809:in `each'
22:09:50 web.1 | from /~.rvm/gems/ruby-2.1.1/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:809:in `bind_new_listeners!'
22:09:50 web.1 | from /~.rvm/gems/ruby-2.1.1/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:138:in `start'
22:09:50 web.1 | from /~.rvm/gems/ruby-2.1.1/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
22:09:50 web.1 | from /~.rvm/gems/ruby-2.1.1/bin/unicorn:23:in `load'
22:09:50 web.1 | from /~.rvm/gems/ruby-2.1.1/bin/unicorn:23:in `<main>'
22:09:50 web.1 | from /~.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
22:09:50 web.1 | from /~.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
22:09:50 web.1 | exited with code 1
22:09:50 system | sending SIGTERM to all processes
有人可以给我一个提示来解决这个问题吗?