rack/rack-contrib — Issue #48: TryStatic
Author: meskyanichi
Created: 2012-02-01 00:49:25+00:00
State: open

Hi there,

I'm trying to make use of `TryStatic` and it seems to work but on every request I get the following:

```
127.0.0.1 - - [01/Feb/2012 01:44:30] "GET /index.html HTTP/1.1" 304 - 0.0006
ArgumentError: wrong number of arguments (1 for 0)
/Users/Michael/Desktop/rwm/config.ru:16:in `block (2 levels) in

'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/rack-contrib-1.1.0/lib/rack/contrib/try_static.rb:33:in `call'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/rack-contrib-1.1.0/lib/rack/contrib/try_static.rb:33:in `call'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/lint.rb:48:in `_call'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/lint.rb:36:in `call'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/showexceptions.rb:24:in `call'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/commonlogger.rb:20:in `call'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/chunked.rb:43:in `call'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/connection.rb:80:in `block in pre_process'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/connection.rb:78:in `catch'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/connection.rb:78:in `pre_process'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/connection.rb:53:in `process'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/connection.rb:38:in `receive_data'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/server.rb:159:in `start'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/handler/thin.rb:13:in `run'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/server.rb:137:in `start'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/bin/rackup:4:in `'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/bin/rackup:19:in `load'
/Users/Michael/.rvm/gems/ruby-1.9.3-p0/bin/rackup:19:in `

'
```

The contents of my `config.ru` are:

```ruby
require "rack"
require "rack/contrib/try_static"

use Rack::TryStatic,
:root => "public",
:urls => ["/"],
:try => ['.html', 'index.html', '/index.html']

# otherwise 404 NotFound
run lambda { [404, {'Content-Type' => 'text/html'}, ['whoops! Not Found']] }
```

I'm using **rack (1.4.1)** and **rack-contrib (1.1.0)** and I run the app using:

rackup