Sinatra on OS X

Hi all,

If I setup a basic Sinatra application I can access it on the machine it
is running on with http://localhost:4567 but I can’t access it from
another machine. There is something with the firewall that seems to
block it but I’ve not been able to find the fix. My google searches have
only provided solutions for Apache and I’ve not been able to see through
how I could use that information for a Sinatra application.

I’ve somehow managed to get things to work with a yard server whilst
working on my documentation so that I can access documentation I’m
working on from another machine. The only difference I believe is the
port number (8808) so somehow I have done something to have access to
that port number.

I’m running OSX Mavericks or Yosemite. Hopefully a Mavericks solution
will work for both. I’m only running the default install of ruby which
comes with OS X and I am not looking for a solution that involves
installing RVM.

Kevin

On Wed, Sep 17, 2014 at 11:04 am, Kevin
Meaney <[email protected]> wrote:

Hi all,

If
I setup a basic Sinatra application I can access it on the machine it is
running on with http://localhost:4567 but I can’t access it from another
machine. There is something with the firewall that seems to block it but
I’ve not been able to find the fix. My google searches have only
provided solutions for Apache and I’ve not been able to see through how
I could use that information for a Sinatra application.

By default Sinatra
will only listen for connections from the localhost in
development. 

To change this you can use
set :bind, '0.0.0.0’
For more info see
the :bind option[1]

Steve

 

I’ve
somehow managed to get things to work with a yard server whilst working
on my documentation so that I can access documentation I’m working on
from another machine. The only difference I believe is the port number
(8808) so somehow I have done something to have access to that port
number.

I’m running OSX Mavericks or Yosemite. Hopefully a
Mavericks solution will work for both. I’m only running the default
install of ruby which comes with OS X and I am not looking for a
solution that involves installing
RVM.

Kevin



Thanks.

Works as you described. It didn’t even occur to me that this was a
Sinatra configuration issue so I was asking the wrong questions of
google.

Kevin