运行rails s
之后,没有异常,但是打开 localhost 之后,提示We're sorry, but something went wrong.If you are the application owner check the logs for more information.
检查development.log
之后,发现错误IPAddr::InvalidAddressError: invalid address
,日志截取如下:
Started GET "/" for fe80::1%lo0 at 2016-09-14 13:57:41 +0800
IPAddr::InvalidAddressError: invalid address
from /Users/Shu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/ipaddr.rb:560:in `in6_addr'
from /Users/Shu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/ipaddr.rb:497:in `initialize'
from /Users/Shu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/ipaddr.rb:515:in `new'
from /Users/Shu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/ipaddr.rb:515:in `coerce_other'
from /Users/Shu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/ipaddr.rb:171:in `include?'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/web-console-3.1.1/lib/web_console/whitelist.rb:17:in `block in include?'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/web-console-3.1.1/lib/web_console/whitelist.rb:17:in `any?'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/web-console-3.1.1/lib/web_console/whitelist.rb:17:in `include?'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/web-console-3.1.1/lib/web_console/request.rb:16:in `from_whitelisted_ip?'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/web-console-3.1.1/lib/web_console/whiny_request.rb:8:in `from_whitelisted_ip?'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/web-console-3.1.1/lib/web_console/middleware.rb:20:in `block in call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/web-console-3.1.1/lib/web_console/middleware.rb:18:in `catch'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/web-console-3.1.1/lib/web_console/middleware.rb:18:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/rack/logger.rb:36:in `call_app'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/rack/logger.rb:24:in `block in call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0/lib/active_support/tagged_logging.rb:70:in `block in tagged'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0/lib/active_support/tagged_logging.rb:26:in `tagged'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0/lib/active_support/tagged_logging.rb:70:in `tagged'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/rack/logger.rb:24:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/quiet_assets.rb:13:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0/lib/action_dispatch/middleware/request_id.rb:24:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/rack-2.0.1/lib/rack/method_override.rb:22:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/rack-2.0.1/lib/rack/runtime.rb:22:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0/lib/action_dispatch/middleware/executor.rb:12:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0/lib/action_dispatch/middleware/static.rb:136:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/rack-2.0.1/lib/rack/sendfile.rb:111:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0/lib/rails/engine.rb:522:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/puma/configuration.rb:224:in `call'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/puma/server.rb:569:in `handle_request'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/puma/server.rb:406:in `process_client'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/puma/server.rb:271:in `block in run'
from /Users/Shu/.rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/puma/thread_pool.rb:114:in `block in spawn_thread'
查询谷歌之后,找到一个类似情况的,但是没有人给出答案,求指导一下,是不是因为添加了 Mina 的原因?
使用 -b 来指定一个地址运行即可,例如rails s -b 0.0.0.0