Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...