Cannot assign requested address - bind(2) (Errno::EADDRNOTAVAIL)

后端 未结 5 381
囚心锁ツ
囚心锁ツ 2020-12-19 04:48

I am using rail for teambox at centos 6.3 server, actually this is just a trial and error before applying it live.

  • I\'m using 2 virtual box that running on sa
相关标签:
5条回答
  • 2020-12-19 05:29

    Try as following:

    development:
     adapter: mysql
     host: 127.0.0.1
     port: 3306
     username: teambox
     password: pass
     database: teambox
    


    (or)

    development:
     adapter: mysql
     host: localhost
     port: 3306
     username: teambox
     password: pass
     database: teambox
    


    I think any of the above will work.

    0 讨论(0)
  • 2020-12-19 05:30

    try this

    rails server -e development -b 0.0.0.0 -p 3000
    

    0.0.0.0 means it listens on all IPv4 addresses on the local machine

    0 讨论(0)
  • 2020-12-19 05:34

    The error is coming becuase 3000 port is already in use. And the command is trying to run in the same port. so change the port and run. add this also -p 3002

    0 讨论(0)
  • 2020-12-19 05:38

    This means the server is already running on that port

    try

    rails server -e development -p 3001 -b 192.168.7.202
    
    0 讨论(0)
  • 2020-12-19 05:40

    Rails 5.0.0.1 server not working without IPv6.

    You need to enable IPv6 from /etc/sysctl.conf file(IPv6 is enabled by default).

    Remove or comment these lines if you have any.

    net.ipv6.conf.all.disable_ipv6 = 1
    
    net.ipv6.conf.default.disable_ipv6 = 1
    
    net.ipv6.conf.lo.disable_ipv6 = 1
    

    Reboot the server to enable IPv6. Try:

    rails server
    
    0 讨论(0)
提交回复
热议问题