-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ruby server demo from website crashes. #25
Comments
That's because Rack's development middleware doesn't work with Thin async responses. You can run your app in production mode to prune out the
Maybe I need to make this more prominent on the website; you're not the first person to report this problem. |
Good to know. I actually was using -E production .. I wasn't seeing any output, so I switched to development thinking it'd log the errors. If those errors aren't related, I'll have to figure out why it wasn't working... |
seems to be working now. I must have made a simple mistake. |
OH! Please!! I spent hours trying to track this down. :-( Please kill the server with a meaningful error if it doesn't work in development. e.g. raise NotSupported.new("Please run in production mode") if RACK_ENV != 'production' |
The issue is really the the middleware that Rack uses in development mode happens not to understand Thin async responses. To make this really robust you would need to detect the presence of such middlewares higher up the stack, since the user may add them manually even if Rack does not. Just checking for production environment is too removed from the real problem to be of use. This is the sort of thing that is best worked around with clear documentation -- does the website need clarifying? |
I just ran into this again, please do document this on the website stating that even in development, production mode should (rather, must) be used. |
It's here in the docs: http://faye.jcoglan.com/ruby.html. Where else should I put it so this stops happening? |
I see that the command: rackup config.ru -s thin -E production is present in the documentation. However, I assumed that the environment option was merely to be used in deployment, so I omitted that on my development machine. I think that the fact that it must be run in production mode even on development machines should be documented. Thanks! |
What am I supposed to do if I am mounting the |
@andrewhavens Run that app using |
I looked in that above linked documentation page. Then I came across the error, then this thread. There is no mention of "production", "development" nor "environment" in that docs page in its current version. |
@mattconnolly The docs link to this page that explains how to run Faye with various different web servers. This thread dates from a time when we only supported Thin. |
Copying the demo from the website, I have:
then I copy the client demo and run it, but the server dies with:
Rack::Lint::LintError: Status must be >=100 seen as integer
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/lint.rb:19:in
assert' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/lint.rb:425:in
check_status'/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/lint.rb:50:in
_call' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/lint.rb:36:in
call'/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/showexceptions.rb:24:in
call' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/commonlogger.rb:18:in
call'/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/content_length.rb:13:in
call' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/chunked.rb:15:in
call'/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/thin-1.2.7/lib/thin/connection.rb:76:in
pre_process' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/thin-1.2.7/lib/thin/connection.rb:74:in
catch'/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/thin-1.2.7/lib/thin/connection.rb:74:in
pre_process' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/thin-1.2.7/lib/thin/connection.rb:57:in
process'/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/faye-0.5.2/lib/thin_extensions.rb:44:in
receive_data' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in
run_machine'/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in
run' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/thin-1.2.7/lib/thin/backends/base.rb:57:in
start'/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/thin-1.2.7/lib/thin/server.rb:156:in
start' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/handler/thin.rb:14:in
run'/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/server.rb:213:in
start' /Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/lib/rack/server.rb:100:in
start'/Users/steven/.rvm/gems/ree-1.8.7-2010.02/gems/rack-1.2.1/bin/rackup:4
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/bin/rackup:19:in `load'
/Users/steven/.rvm/gems/ree-1.8.7-2010.02/bin/rackup:19
127.0.0.1 - - [27/Aug/2010 13:22:17] "POST /faye HTTP/1.1" 500 62371 0.0206
The text was updated successfully, but these errors were encountered: