Your problem is with the line:
SingingRain.run!
This is the Sinatras run method, which tells Sinatra to start its own web server, which by default runs on port 4567. This is in your config.ru file, but config.ru is just Ruby, so this line starts as if it was in any other .rb file. This is why you see Sinatra running on this port.
When you stop this server using CTRL-C, Thin will try to continue loading the config.ru file to determine which application to run. In fact, you are not specifying the application in your config.ru , so you will see something like:
^C>> Stopping ... == Sinatra has ended his set (crowd applauds) /Users/matt/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:129:in `to_app': missing run or map statement (RuntimeError) from config.ru:1:in `<main>' ...
This error simply tells you that you did not actually specify the application to run in your configuration file.
Instead of SingingRain.run! use:
run SingingRain
run is a Rack method that indicates which application to run. You can also do run SingingRain.new - Sinatra takes steps so that you can use only the class itself or instance.
The conclusion to this now should only be:
>> Thin web server (v1.4.1 codename Chromeo) >> Maximum connections set to 1024 >> Listening on 0.0.0.0:8000, CTRL+C to stop
You will not receive the message == Sinatra/1.3.2 has taken the stage on 4567 for production with backup from Thin , because Sinatra does not start its built-in server, but only your thin server, as you configured it.
matt
source share