简体   繁体   English

Rails服务器无法启动

[英]Rails server not starting

`start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)

I can confirm that this is a not a port issue. 我可以确认这不是端口问题。 It happened after I changed by /etc/hosts file to use my custom domain name pointing to 127.0.0.1 but after I changed that rails server is not starting in any port. 在通过/ etc / hosts文件更改为使用指向127.0.0.1的自定义域名后,但是在更改后,Rails服务器没有在任何端口中启动都发生了。

The command I am using to star: rvmsudo rails s -p 80 我用来加注星标的命令:rvmsudo rails s -p 80

Here is how my etc/hosts file look like 这是我的etc / hosts文件的样子

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       platform.adwyze.com
255.255.255.255 broadcasthost 
::1             platform.adwyze.com

Usually rails server being started by rails s or rails s -p 5000 . 通常,rails服务器由rails srails s -p 5000 I guess it should not being started in 80 port. 我猜它不应该在80端口启动。 Try to start it by these commands instead rails s -p 80 尝试通过以下命令启动它,而不是用rails s -p 80

UPDATE : You can find and kill after process that using 3000 by: 更新 :您可以通过以下方法查找并杀死使用3000的进程:

lsof -i :3000

kill -9 found_pid

Also it's possible to run the server by bundle exec rails server -b 0.0.0.0 -p 3001 也可以通过bundle exec rails server -b 0.0.0.0 -p 3001运行服务器

尝试做sudo rails server -p 80 ,如果platform.adwyze.com在https上,请在chrome地址栏上将https更改为http,然后platform.adwyze.com将指向您的本地服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM