Sinatra server not getting access other than localhost

1,184 views
Skip to first unread message

aj.ort...@gmail.com

unread,
Jan 28, 2014, 11:50:13 PM1/28/14
to sina...@googlegroups.com
I am trying to run a server with sinatra in a mac running osx 10.9 which connects with localhost but can not access the server with the ip address nor from other computers. I have already checked and have no firewalls and i am executing the server with ruby filename.rb -o 0.0.0.0 and -env production and even setting the bind on the rb file as well but it still doesn't allow access. Any idea on how to allow access to the server? Thanks in advance.

Carlos Eduardo L. Lopes

unread,
Jan 29, 2014, 5:53:08 AM1/29/14
to sina...@googlegroups.com
By default Sinatra runs on 0.0.0.0:4567 (you must type the port number, because your browser will try to connect on 80 and Sinatra runs on 4567 by default).

Like some others Ruby web servers, the default IP address associated to your app is 0.0.0.0, so you should be able to access it from any machine on your local network.

January 29, 2014 at 2:50
I am trying to run a server with sinatra in a mac running osx 10.9 which connects with localhost but can not access the server with the ip address nor from other computers. I have already checked and have no firewalls and i am executing the server with ruby filename.rb -o 0.0.0.0 and -env production and even setting the bind on the rb file as well but it still doesn't allow access. Any idea on how to allow access to the server? Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sinatrarb+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Carlos Eduardo L. Lopes
Hangout: carlos....@gmail.com | Twitter: @_carloslopes

konstant...@gmail.com

unread,
Jan 29, 2014, 9:20:25 AM1/29/14
to sina...@googlegroups.com
0.0.0.0 is not an IP address, it’s a placeholder that means “on all interfaces/IP addresses” (including 127.0.0.1).

Konstantin
signature.asc

Carlos Eduardo L. Lopes

unread,
Jan 29, 2014, 9:23:26 AM1/29/14
to sina...@googlegroups.com
Sorry about that mistake :S

January 29, 2014 at 12:20
0.0.0.0 is not an IP address, it’s a placeholder that means “on all interfaces/IP addresses” (including 127.0.0.1).

Konstantin



January 29, 2014 at 8:53
By default Sinatra runs on 0.0.0.0:4567 (you must type the port number, because your browser will try to connect on 80 and Sinatra runs on 4567 by default).

Like some others Ruby web servers, the default IP address associated to your app is 0.0.0.0, so you should be able to access it from any machine on your local network.


January 29, 2014 at 2:50
I am trying to run a server with sinatra in a mac running osx 10.9 which connects with localhost but can not access the server with the ip address nor from other computers. I have already checked and have no firewalls and i am executing the server with ruby filename.rb -o 0.0.0.0 and -env production and even setting the bind on the rb file as well but it still doesn't allow access. Any idea on how to allow access to the server? Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sinatrarb+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

aj.ort...@gmail.com

unread,
Jan 29, 2014, 11:44:47 PM1/29/14
to sina...@googlegroups.com
I tried to access with the IP:4567 from a browser from my phone but it does not access, but it does now from the browser used in the same computer that holds the server

Carlos Eduardo L. Lopes

unread,
Jan 30, 2014, 2:24:46 AM1/30/14
to sina...@googlegroups.com

Are you using the local IP address of your machine?

aj.ort...@gmail.com

unread,
Feb 20, 2014, 8:29:29 PM2/20/14
to sina...@googlegroups.com
Sorry for not being able to continue answering the group. I'm running the ruby file like ruby file.rb -o 0.0.0.0 -p 4567 and the only ways I can access the content are in side my computer like 0.0.0.0:4567 and 127.0.0.1:4567 but trying to use my computer's IP is not reaching the server

Budhram Gurung

unread,
Jun 6, 2014, 3:34:24 AM6/6/14
to sina...@googlegroups.com
I am also getting the same issue.

Any luck on running the sinatra app from outside local server?

tamouse pontiki

unread,
Jun 6, 2014, 6:02:18 PM6/6/14
to sina...@googlegroups.com
This sounds very little like anything to do with sinatra and nearly everything to do with understanding how to turn your local machine into a server that can be accessed from another machine.

First off, can you ping your local machine from the other machine? That will establish if you can connect to it at all. Second, if you are trying to access your local machine from a different network (for example, if you're using your phone through the 3G/4G connection instead of the local wifi, you will need to open up your local network, which can create insecurities if you don't know what you're doing (and this is not the place to give a tutorial on that).




--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sinatrarb+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pablito Borda

unread,
Jul 27, 2014, 5:51:06 PM7/27/14
to sina...@googlegroups.com
I HAVE THE SAME PROBLEM, IT USED TO WORK BEFORE, I DUNNO WHAT HAPPENED. IM USING DIGITALOCEAN
THIS IS SO ANNOYING...
Any alternatives? anyone was able to solve it?

Konstantin Haase

unread,
Aug 8, 2014, 4:23:33 AM8/8/14
to sina...@googlegroups.com
Are you sure you're not running in development mode for some reason?

Konstantin


--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sinatrarb+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages