Home > App Error > App Error Body Yielded Non-string Value

App Error Body Yielded Non-string Value


How can I remove perfectly round locking wheel lugs? Should an elected official feel obligated to vote on an issue based on the majority opinion of his constituents? "the chemical and physical changes it undergoes" -- What does the clause if env[RACK_IS_HIJACK] && headers[RACK_HIJACK] assert('rack.hijack header must respond to #call') { headers[RACK_HIJACK].respond_to? :call } original_hijack = headers[RACK_HIJACK] headers[RACK_HIJACK] = proc do |io| original_hijack.call HijackWrapper.new(io) end else ## ## The special response You can replicate this error with curl if you specify "Accept-Encoding" header: curl -H "Accept-Encoding: gzip" http://localhost:9292/v1/swagger.json kennethklee self-assigned this Jul 2, 2015 Mashape member kennethklee commented Jul 2, 2015 @mosic

What is the difference between touch file and > file? Reload to refresh your session. yegortimoshenko referenced this issue Sep 25, 2013 Merged #send_file indifferent :status option #787 blakewatters commented Sep 25, 2013 Looks good. Usage of "it" to start a sentence Force Microsoft Word to NEVER auto-capitalize the name of my company RemoteAction Vs REST? recommended you read

Sinatra Validation

Browse other questions tagged ruby sinatra or ask your own question. [email protected]:~/projects/evercam-devops$ vagrant ssh ==> default: The machine you're attempting to SSH into is configured to use ==> default: password-based authentication. I'll see if I can demonstrate this, will get back to you some other time. If you just pull the branch and run ruby test/static_test.rb you will immediately run into it.

Why? refs sinatra/sinatra#749 5877a9d Sinatra member patriciomacadden commented Aug 16, 2013 Hi! Owner vast commented Oct 22, 2011 Well, at least sinatra-redirect-with-flash works now. Sinatra Activerecord Add test case highlighting the breakage when attempting to use `send_file` with a specific status code.

I figure that it had to do with what the http method being called (in this case was a call to a PUT ) was returning. If ## the body is replaced by a middleware after action, the original body ## must be closed first, if it responds to close. # XXX howto: assert("Body has not been Thanks again! http://stackoverflow.com/questions/7701113/rack-error-racklintlinterror-response-body-must-respond-to-each Which is faster?

halt opts[:status].to_i || result[0], result[2] end yegortimoshenko commented Sep 25, 2013 @patriciomacadden, do you think this should be merged? (opts[:status] → opts[:status].to_i) Sinatra member patriciomacadden commented Sep 25, 2013 If it refs sinatra/sinatra#749">Add test case highlighting the breakage when attempting to use `send_… … …file` with a specific status code. May be ## empty, but is always required! ## SERVER_NAME, SERVER_PORT:: ## When combined with SCRIPT_NAME and ## PATH_INFO, these variables can be ## used to complete the URL. status.to_i } @content_length = value end } end def verify_content_length(bytes) if @head_request assert("Response body was given for HEAD request, but should be empty") { bytes == 0 } elsif @content_length assert("Content-Length

Sinatra Form Validation

Normally, this will only be true ## for a server based on CGI ## (or something similar). ## rack.hijack?:: present and true if the server supports ## connection hijacking. https://github.com/sinatra/sinatra/issues/749 if bufsize = env[RACK_MULTIPART_BUFFER_SIZE] assert("rack.multipart.buffer_size must be an Integer > 0 if specified") { bufsize.is_a?(Integer) && bufsize > 0 } end ## rack.multipart.tempfile_factory:: An object responding to #call with two arguments, Sinatra Validation asked 3 years ago viewed 3752 times active 3 years ago Related 99How to get Sinatra to auto-reload the file after each change?119Serving static files with Sinatra2Sinatra Set Settings (Ruby)3Ruby and Active Record Validation Not sure what the rails api doc will do me in sinatra.

io = original_hijack.call HijackWrapper.new(io) ## ## rack.hijack_io must respond to: ## read, write, read_nonblock, write_nonblock, flush, close, ## close_read, close_write, closed? ## ## The semantics of these IO methods must be Btw you're getting an encrypted response? We recommend upgrading to the latest Safari, Google Chrome, or Firefox. Personal Open source Business Explore Sign up Sign in Pricing Blog Support Search GitHub This repository Watch 388 Star 8,264 Fork 1,557 sinatra/sinatra Code Issues 34 Pull requests 13 Projects 0 Sinatra Flash

ERROR Rack::Lint::LintError: Response body must respond to each /Users/adam/.rvm/gems/ruby-1.9.3-preview1/gems/rack-1.3.4/lib/rack/lint.rb:19:in `assert' /Users/adam/.rvm/gems/ruby-1.9.3-preview1/gems/rack-1.3.4/lib/rack/lint.rb:513:in `each' /Users/adam/.rvm/gems/ruby-1.9.3-preview1/gems/rack-1.3.4/lib/rack/body_proxy.rb:23:in `method_missing' /Users/adam/.rvm/gems/ruby-1.9.3-preview1/gems/rack-1.3.4/lib/rack/chunked.rb:23:in `each' /Users/adam/.rvm/gems/ruby-1.9.3-preview1/gems/rack-1.3.4/lib/rack/handler/webrick.rb:71:in `service' /Users/adam/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' /Users/adam/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' /Users/adam/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' This is the program im env[RACK_HIJACK_IO] = HijackWrapper.new(env[RACK_HIJACK_IO]) io end else ## ## If rack.hijack? is merely calling down to send_file with a disposition: nil. Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc.

next if key =~ /^rack\..+$/ ## The header keys must be Strings. Skip to content Ignore Learn more Please note that GitHub no longer supports old versions of Firefox. The trailing whitespace between paragraphs is important and # should not be removed.

Simple answer to that is just to add the [] to the string, turning it into an array and therefore supporting each.

We will work on a stable reproducer. String } bytes += part.bytesize yield part } verify_content_length(bytes) ## ## The Body itself should not be an instance of String, as this will ## break in Ruby 1.9. ## ## Sinatra member patriciomacadden commented Sep 25, 2013 Nice! Moment of selecting a target from an ability of a planeswalker An empire to last a hundred centuries How did Samba, Krishna's son, get relieved from Curse of Krishna?

I'd use unless @errors.empty?… as the condition, and pass @errors to a template to render using a block, probably like - @errors.full_messages.each do |error| etc. –iain Apr 14 '13 at 2:29 multiple ## Set-Cookie values) separated by "\\n". It used to be that a String in Ruby would respond to each with an iteration of characters. Mashape member kennethklee commented Jun 29, 2015 @mosic hey what's the password to the vagrant box?

Reload to refresh your session. In evercam-api, I added analytics to config.ru here: # Enable gzip use Rack::Deflater # Enable Analytics use MashapeAnalytics::Frameworks::Rack, ... For that purpose, use the ## body streaming API instead (progressively yielding strings via each). ## ## Servers must ignore the body part of the response tuple when ## the rack.hijack header } } ## The environment must not contain the keys ## HTTP_CONTENT_TYPE or HTTP_CONTENT_LENGTH ## (use the versions without HTTP_). %w[HTTP_CONTENT_TYPE HTTP_CONTENT_LENGTH].each { |header| assert("env contains #{header}, must use #{header[5,-1]}")

Sinatra member patriciomacadden commented Sep 25, 2013 to reflect that the status option works with 422 and '422' for example. See v1.0.3. I have a postgres db. Thoughts? –jahrichie Apr 14 '13 at 2:13 I've just been looking at api.rubyonrails.org/v2.3.8/classes/ActiveRecord/… and the two methods that I think you'll need are empty?

Related 8rvm rack ruby error already initialized constant WFKV_7Rack Error — LoadError: cannot load such file5How to resolve Rack Lint errors?0Getting rack error Rack::Lint::LintError: Status must be >=100 seen as integer3Debugging I have just rebased against the latest master and tried the test again and it is still failing. yegortimoshenko commented Sep 25, 2013 The problem was in :status option itself. Already have an account?

assert("rack.hijack? asked 2 years ago viewed 1161 times active 2 years ago Related 7How do you create case insensitive routes in Sinatra?164Using Sinatra for larger projects via multiple files18Including local (JS and Thanks in advance though. –jahrichie Apr 14 '13 at 1:36 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted From the documentation: The return value