Thursday, June 19, 2008

Now I can access the WEBrick server

As you know you can access a Rails project via browser by calling
 http://localhost:3000/.../... 
But when I try to access this project from other computers by calling
http://[computer_name]:3000/.../...

or
http://[ip_address]:3000/.../...
, IE or FireFox just can't reach the web page.

This problem bothered me for a while. I read some articles about how WEBrick works but did find how to make visible to other computers.

Today I have to ask helps from Rails community and finally found the solution. There is nothing to with how to config the WEBrick. It is simple as this:


Ruby script/server -b [ip_address] -p [port]


Now I can access the pages from other computers. Pretty happy.

No comments: