无法分配请求的地址 - bind(2)(Errno :: EADDRNOTAVAIL) [英] Cannot assign requested address - bind(2) (Errno::EADDRNOTAVAIL)

查看:1442
本文介绍了无法分配请求的地址 - bind(2)(Errno :: EADDRNOTAVAIL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在centos 6.3服务器上使用railbox作为teambox,实际上这只是一个试用和错误,然后才能应用。


  • 我使用2个运行在相同centos版本和精确拷贝上的虚拟盒子,VM2只运行mysql,它将远离VM1

  • 我尝试了mysql连接#nc并且它已连接

  • VM1(192.168.7.201)& VM2(运行MYSQL的192.168.7.202)
  • 我在my.cnf的远程机器(VM2)上绑定地址,绑定地址= 192.168.7.202

  • 这是我的database.yml




开发:
适配器:mysql
主机:192.168.7.202
端口:
3306
用户名:teambox
密码:pass
数据库:
teambox




,我试着用# rails server -e development -b 192.168.7.202
运行,错误

 正在退出
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5 /lib/mongrel/tcphack.rb:12:in`initialize_without_backlog':无法分配请求的地址 - bind(2)(Errno :: EADDRNOTAVAIL)

请帮我解决

解决方案

试试这个

  rails server -e development -b 0.0.0.0 -p 3000 

0.0.0.0表示它监听所有的IPv4本地计算机上的地址

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 same centos version and exact copy, VM2 is only run mysql that will be remote from VM1
  • I have tried mysql connection #nc and it's connected
  • VM1 (192.168.7.201) & VM2 (192.168.7.202 running MYSQL)
  • I have bind-address on remote machine (VM2) in my.cnf with bind-address=192.168.7.202
  • here's my database.yml

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

and I am trying to run with #rails server -e development -b 192.168.7.202 and giving this error

Exiting
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/tcphack.rb:12:in `initialize_without_backlog': Cannot assign requested address - bind(2) (Errno::EADDRNOTAVAIL)

please help me out

解决方案

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

这篇关于无法分配请求的地址 - bind(2)(Errno :: EADDRNOTAVAIL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆