It's a warning, not an error. You can safely ignore it, and there's nothing you can do to stop it from coming up without editing the rack
source code. If the warning bugs you, you can always temporarily silence Ruby with this method from Rails:
def silence_stream(stream)
old_stream = stream.dup
stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
stream.sync = true
yield
ensure
stream.reopen(old_stream)
end
silence_stream(STDERR) do
silence_stream(STDOUT) do
require 'sinatra'
end
end
# rest of code as usual...
Or to block just warnings instead of the entire stderr and stdout streams:
verbose = $VERBOSE
$VERBOSE = nil
require 'sinatra'
$VERBOSE = verbose
# rest of code as usual...
If that isn't working then you're probably blocking the wrong part of the code. Since rack is causing the warning, I'd assume that it happens when rack is first required. This probably is done through Sinatra for you, which is why I was saying to block warnings for the duration of requiring sinatra. You could try putting the rest of your require
s on the lines immediately next to require 'sinatra'
in either of the above.