Ruby on rails 无法连接到Fedora 21上的rails服务器

Ruby on rails 无法连接到Fedora 21上的rails服务器,ruby-on-rails,fedora,Ruby On Rails,Fedora,我启动了rails服务器,但是http://192.168.56.104:3000不可用。它的地址是正确的,因为我可以在http://192.168.56.104:80 我启动了服务器: $ rails s Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path)

我启动了
rails服务器
,但是
http://192.168.56.104:3000
不可用。它的地址是正确的,因为我可以在
http://192.168.56.104:80

我启动了服务器:

$ rails s
Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-03-10 09:45:49] INFO  WEBrick 1.3.1
[2015-03-10 09:45:49] INFO  ruby 2.1.5 (2014-11-13) [x86_64-linux]
[2015-03-10 09:45:49] INFO  WEBrick::HTTPServer#start: pid=5512 port=3000
然后它开始工作:

# wget http://localhost:3000; head index.html 
--2015-03-10 09:53:39--  http://localhost:3000/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:3000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14935 (15K) [text/html]
Saving to: ‘index.html’

index.html         100%[=================>]  14.58K  --.-KB/s   in 0.001s 

2015-03-10 09:53:39 (18.1 MB/s) - ‘index.html’ saved [14935/14935]

<!DOCTYPE html>
<html>
  <head>
    <title>Ruby on Rails: Welcome aboard</title>
    <style media="screen">
      body {
        margin: 0;
        margin-bottom: 25px;
        padding: 0;
        background-color: #f0f0f0;
防火墙设置包括:

# firewall-cmd --list-all
FedoraServer (default, active)
  interfaces: enp0s3 enp0s8
  sources: 
  services: cockpit dhcpv6-client http ssh
  ports: 
  masquerade: no
  forward-ports: 
  icmp-blocks: 
  rich rules: 
以及:

以及:


我应该检查和修复什么?

已解决!我必须使用
-b
使rails服务器不仅在本地主机上工作

$ rails s -b 0.0.0.0
更改为:

# firewall-cmd --permanent --zone=FedoraServer --list-all
FedoraServer (default)
  interfaces: 
  sources: 
  services: cockpit dhcpv6-client http ssh
  ports: 
  masquerade: no
  forward-ports: 
  icmp-blocks: 
  rich rules: 
# cat /etc/firewalld/services/http.xml 
<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>WWW (HTTP)</short>
  <description>HTTP is the protocol used to serve Web pages. If you plan to make your Web server publicly available, enable this option. This option is not required for viewing pages locally or developing Web pages.</description>
  <port protocol="tcp" port="3000"/>
  <port protocol="tcp" port="80"/>
</service>
# cat /etc/fedora-release 
Fedora release 21 (Twenty One)
$ rails s -b 0.0.0.0