地址已经在使用 - bind(2)(Errno :: EADDRINUSE)(Address already in use - bind(2) (Errno::EADDRINUSE))
我正在尝试使用Puma Web服务器部署Rails应用程序。 当尝试使用配置文件
bundle exec puma -C config/puma.rb
启动Puma服务器bundle exec puma -C config/puma.rb
我收到一个错误,该地址已被使用。有人知道如何解决这个问题吗?
bundle exec puma -C config/puma.rb [23699] Puma starting in cluster mode... [23699] * Version 2.11.3 (ruby 2.0.0-p353), codename: Intrepid Squirrel [23699] * Min threads: 5, max threads: 5 [23699] * Environment: development [23699] * Process workers: 2 [23699] * Preloading application Jdbc-MySQL is only for use with JRuby [23699] * Listening on tcp://0.0.0.0:3000 /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/binder.rb:210:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE) from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/binder.rb:210:in `new' from /Users/lexi87/.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/binder.rb:210:in `add_tcp_listener' from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/binder.rb:96:in `block in parse' from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/binder.rb:82:in `each' from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/binder.rb:82:in `parse' from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/runner.rb:119:in `load_and_bind' from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/cluster.rb:302:in `run' from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/cli.rb:216:in `run' from /rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/bin/puma:10:in `<top (required)>' from /.rvm/gems/ruby-2.0.0-p353/bin/puma:23:in `load' from /.rvm/gems/ruby-2.0.0-p353/bin/puma:23:in `<main>' from /.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval' from /.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
I am trying to deploy Rails app with the Puma web server. When trying to start Puma server with a config file
bundle exec puma -C config/puma.rb
I get an error that the address is already in use.Does someone know how to fix this?
bundle exec puma -C config/puma.rb [23699] Puma starting in cluster mode... [23699] * Version 2.11.3 (ruby 2.0.0-p353), codename: Intrepid Squirrel [23699] * Min threads: 5, max threads: 5 [23699] * Environment: development [23699] * Process workers: 2 [23699] * Preloading application Jdbc-MySQL is only for use with JRuby [23699] * Listening on tcp://0.0.0.0:3000 /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/binder.rb:210:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE) from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/binder.rb:210:in `new' from /Users/lexi87/.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/binder.rb:210:in `add_tcp_listener' from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/binder.rb:96:in `block in parse' from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/binder.rb:82:in `each' from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/binder.rb:82:in `parse' from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/runner.rb:119:in `load_and_bind' from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/cluster.rb:302:in `run' from /.rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/lib/puma/cli.rb:216:in `run' from /rvm/gems/ruby-2.0.0-p353/gems/puma-2.11.3/bin/puma:10:in `<top (required)>' from /.rvm/gems/ruby-2.0.0-p353/bin/puma:23:in `load' from /.rvm/gems/ruby-2.0.0-p353/bin/puma:23:in `<main>' from /.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval' from /.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
原文:https://stackoverflow.com/questions/31039998
最满意答案
首先看时间= 0秒,因此,它可能/可能不会导致执行,可能是第0次机会(没机会)浏览器应该在0秒内重新加载当前页面
以及使用元刷新标签的一些缺点
元刷新标签有一些缺点:
垃圾邮件发送者使用元刷新重定向来欺骗搜索引擎。 因此搜索引擎会从其数据库中删除这些网站。 如果您使用大量元刷新标记来重定向页面,搜索引擎可能会决定您的网站是垃圾邮件并将其从索引中删除。 最好使用301服务器重定向。
如果重定向很快发生(少于2-3秒),使用旧版浏览器的读者无法点击“返回”按钮。 这是一个可用性问题。
如果重定向很快发生并转到不存在的页面,您的读者可能会陷入循环而不会看到除404页面之外的任何内容。 当这种情况发生时,大多数人只是放弃而不是试图找出你试图把它们拿走的地方。
刷新当前页面可能会让人感到困惑。 如果他们没有请求重新加载,有些人可能会担心安全问题。为什么wint你使用javascript超时?
<script language=”javascript” type=”text/javascript”> setTimeout(function () { window.location.href = "tea.html"; //will redirect to your blog page (an ex: tea.html) }, 2000); //will call the function after 2 secs. </script>
firstly look time=0 seconds,so, it may/may not cause an execute , probably 0th chance (No chance) the browser should reload the current page in 0 seconds
and some Drawbacks to Using Meta Refresh Tags
Meta refresh tags have some drawbacks:
Meta refresh redirects have been used by spammers to fool search engines. So search engines remove those sites from their database. If you use a lot of meta refresh tags to redirect pages, the search engines may decide your site is spam and delete it from their index. It’s better to use a 301 Server Redirect instead.
If the redirect happens quickly (less than 2-3 seconds), readers with older browsers can’t hit the “Back” button. This is a usability problem.
If the redirect happens quickly and goes to a non-existant page, your readers may get stuck in a loop without seeing any content other than a 404 page. When this happens, most people simply give up and leave rather than trying to figure out where you were trying to take them.
Refreshing the current page can confuse people. If they didn’t request the reload, some people can get concerned about security.why wint you use javascript with a time out?
<script language=”javascript” type=”text/javascript”> setTimeout(function () { window.location.href = "tea.html"; //will redirect to your blog page (an ex: tea.html) }, 2000); //will call the function after 2 secs. </script>
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
首先看时间= 0秒,因此,它可能/可能不会导致执行,可能是第0次机会(没机会)浏览器应该在0秒内重新加载当前页面 以及使用元刷新标签的一些缺点 元刷新标签有一些缺点: 垃圾邮件发送者使用元刷新重定向来欺骗搜索引擎。 因此搜索引擎会从其数据库中删除这些网站。 如果您使用大量元刷新标记来重定向页面,搜索引擎可能会决定您的网站是垃圾邮件并将其从索引中删除。 最好使用301服务器重定向。 如果重定向很快发生(少于2-3秒),使用旧版浏览器的读者无法点击“返回”按钮。 这是一个可用性问题。 如果重定向很快发生并转到不 ...
-
您可以使用 但它也有缺点。 例如,如果用户在15秒之前加载下一页。 您可能会收到一些意外的浏览器重新加载 使用javascript你可能会做类似的事情 window.setTimeout(function(){window.location.href=window.location.href},15000); You can use b ...
-
您只需使用代码获得second的值。 您需要在函数内移动变量并将setTimeout更改为setInterval : setInterval(function(){ var seconds = new Date().getSeconds(); if (seconds == 10 || seconds == 15 || seconds == 20) { window.location.reload(1); } }, 1000); You get the value o ...
-
如果加载时间超过10秒,如何刷新页面?(How can I refresh a page if its load time is more than 10 seconds? [duplicate])[2022-03-16]
将每10秒重新加载一次页面(第一次是在页面加载后10秒)。 但是,在页面加载之后才能访问它。 就PHP而言,您可以看到PHP脚本执行的时间是否超过10秒(通过在代码的开头和结尾使用代码段来捕获时间戳),但是如果执行的输出超过10,则不会为用户加载的秒数。 您无法查看用户是否连接速度较慢。 [编辑:]您可以在代码开头设置时间戳并将其回显给用户并进行一些javascript检查以查看请求初始化后是否超过10秒,但这可能会开始因为用户 ... -
当页面上的时间超过30秒时发送谷歌分析事件(Send google analytics event when time on page goes over 30 seconds)[2023-10-04]
您可以在目标下的管理视图设置中在GA中进行设置。 You can set it up in GA in the admin view settings under goals. -
所以我将以下内容添加到我的重定向页面中。 幸运的是,他们没有发布任何内容,因此可以简单地重定向。 此外,使用javascript是可以的,因为它需要到达网站中的那一点。 So I added the followi ...
-
假设脚本没有真正重新格式化: url = page.body[/url = '(.*?)'/, 1] page = @agent.get url Assuming the script isn't really reformatted like that: url = page.body[/url = '(.*?)'/, 1] page = @agent.get url
-
如何在使用异步调用时从javascript更新元刷新?(How can I update meta refresh from javascript when using asynchronous calls?)[2023-11-06]
不会。当页面加载时,元标记会被解释,就好像它是一个实际的HTTP标头一样,并且后加载更改对它没有影响。 你最好放弃元刷新,完全依靠JavaScript来适当地重新加载页面。 如果您必须在没有脚本的情况下支持客户端,则默认为使用元刷新的无脚本页面,并为可以利用它的用户提供JS重定向到启用脚本的(无元刷新)页面。 No. The meta tag is interpreted when the page loads as though it were an actual HTTP header, and pos ...