There are a couple of issues with this code fragment on Heroku: * Your config.ru needs to set up and call "run" on a Rack-compatible application * All Heroku dynos are given one port, passed to thin, so you won't be able to have Websockets listening on an alternate port.
Cheers, David On Aug 27, 7:15 am, "Jose M." <robe5....@gmail.com> wrote: > Hello! > > I am trying to deploy an EventMachine + Sinatra application. I am > getting the next error when pushing the code: > > Launching.................................................................. > .....timed > out > ! App timed out during testfire. The previous version of your app > is still running. > ! Backtrace follows: > ! == Sinatra/1.0 has taken the stage on 4567 for production > with backup from Thin > ! >> Thin web server (v1.2.7 codename No Hup) > ! >> Maximum connections set to 1024 > ! >> Listening on 0.0.0.0:4567, CTRL+C to stop > ! >> Stopping ... > ! >> Thin web server (v1.2.7 codename No Hup) > ! >> Maximum connections set to 1024 > ! >> Listening on 0.0.0.0:46785, CTRL+C to stop > ! Heroku push rejected, app timed out during testfire > > error: hooks/pre-receive exited with error code 1 > > Is it trying to run Thin twice? I am running the sinatra app inside an > event machine loop with another app using event machine sockets and I > am doing it like this: > > #config.ru > require './app.rb' > > #app.rb > require 'rubygems' > require 'bundler/setup' > > require 'em-websocket' > require 'sinatra/base' > require 'thin' > > EventMachine.run do > class Websockets < Sinatra::Base > #sinatra app code > end > > EventMachine::WebSocket.start(:host => "0.0.0.0", :port => > 8080, :debug => true) do |ws| > # websocket server code > end > > Websockets.run! > end > > Am I doing something wrong? Is not possible for this kind of > application to run in heroku? > > Thanks in advance! -- You received this message because you are subscribed to the Google Groups "Heroku" group. To post to this group, send email to her...@googlegroups.com. To unsubscribe from this group, send email to heroku+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/heroku?hl=en.