Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql RubyonRails:权限被拒绝-bind(2)for";“0.0.0.0”;端口80(错误号::EACCES) 复制步骤 我创建了数据库并进行了迁移 我运行了rails服务器_Mysql_Ruby On Rails_Ruby_Server - Fatal编程技术网

Mysql RubyonRails:权限被拒绝-bind(2)for";“0.0.0.0”;端口80(错误号::EACCES) 复制步骤 我创建了数据库并进行了迁移 我运行了rails服务器

Mysql RubyonRails:权限被拒绝-bind(2)for";“0.0.0.0”;端口80(错误号::EACCES) 复制步骤 我创建了数据库并进行了迁移 我运行了rails服务器,mysql,ruby-on-rails,ruby,server,Mysql,Ruby On Rails,Ruby,Server,结果是: [3957]Puma以群集模式启动。。。 [3957]*版本3.10.0(ruby 2.5.1-p57),代号:Russell's Teapot [3957]*最小螺纹数:5,最大螺纹数:5 [3957]*环境:发展 [3957]*工艺工人:4名 [3957]*预加载应用 [3957]*收听tcp://0.0.0.0:80 退出 回溯(最近一次呼叫最后一次): 22:从箱子/轨道:4:in`' 21:从箱子/轨道:4:在'require'中 20:from/home/my_userna

结果是:

[3957]Puma以群集模式启动。。。
[3957]*版本3.10.0(ruby 2.5.1-p57),代号:Russell's Teapot
[3957]*最小螺纹数:5,最大螺纹数:5
[3957]*环境:发展
[3957]*工艺工人:4名
[3957]*预加载应用
[3957]*收听tcp://0.0.0.0:80
退出
回溯(最近一次呼叫最后一次):
22:从箱子/轨道:4:in`'
21:从箱子/轨道:4:在'require'中
20:from/home/my_username/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/commands.rb:18:in`'
19:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/command.rb:46:in“invoke”
18:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/command/base.rb:65:in“perform”
17:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in“dispatch”
16:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in“invoke_命令”
15:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in“run”
14:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in“perform”
13:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in'tap'
12:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:147:in'block in perform'
11:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:53:in'start'
10:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:297:in“开始”
9:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/puma-3.10.0/lib/rack/handler/puma.rb:69:in'run'
8:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/puma-3.10.0/lib/puma/launcher.rb:183:in'run'
7:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/puma-3.10.0/lib/puma/cluster.rb:397:in'run'
6:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/puma-3.10.0/lib/puma/runner.rb:144:in'load_and_bind'
5:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/puma-3.10.0/lib/puma/binder.rb:88:in“parse”
4:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/puma-3.10.0/lib/puma/binder.rb:88:in'each'
3:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/puma-3.10.0/lib/puma/binder.rb:105:in'block in parse'
2:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/puma-3.10.0/lib/puma/binder.rb:270:in'add_tcp_listener'
1:from/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/puma-3.10.0/lib/puma/binder.rb:270:in“new”
/home/my_usernam/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/puma-3.10.0/lib/puma/binder.rb:270:“初始化”中:权限被拒绝-绑定“0.0.0”端口80(Errno::EACCES)

将puma配置为使用不同的端口

# config/puma.rb
port(ENV.fetch('PORT', 3000))
在生产设置中
PORT=80
,在本地开发中
unset PORT


默认情况下,Rails侦听端口3000,您可能已经更改了一些设置以使其在端口80上运行。普通用户无法打开1024以下的端口米加♦


只有
root
可以绑定1024以下的端口。不要以root用户身份运行本地开发服务器!相反,将端口配置为1024以上。

Rails默认在端口3000上侦听,您可能更改了一些设置,使其在端口80上运行。普通用户无法打开1024以下的端口。您需要使用
rvmsudo
或等效工具绑定到1024以下的端口。
rvmsudo rails s-p 80 rvmsudo:command not found
我想这是因为我安装了rbenvHmm,将该行添加到我的配置文件中不会更改最终结果。请检查您的环境变量,例如:
::Rails.logger.info('我的端口设置为:'+ENV['port'))
Permission denied - bind(2) for "0.0.0.0" port 80 (Errno::EACCES)