Search code examples
ruby-on-railssinatralocal-network

Cannot access sinatra app through the local network


I have rails application. If I start it with rails s (port 3000), it works perfectly both on my machine and every device on my local network via the ip address (192.168.0.3 in my case).
I have sinatra application. If I start it with ruby app.rb (port 4567), it works perfectly on my machine, but it it is not accessible from other devices on my local network.

enter image description here

Both application use Thin as an app server.

Is it something related to how sinatra works?


Solution

  • Try ruby app.rb -o 0.0.0.0 or ruby app.rb -e production. Either should work.