ankiit / logstash

Automatically exported from code.google.com/p/logstash
0 stars 0 forks source link

Logstash-web doesn't work with Rack 1.2.1 #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using Ruby 1.8.6p399 on Centos 5. If I install logstash it brings in Rack 
1.2.1. However when launching logstash-web I get following error

$ logstash-web
/usr/lib/ruby/gems/1.8/gems/logstash-0.2.20101208111718/lib/logstash/web/server.
rb:27: warning: parenthesize argument(s) for future version
/usr/lib/ruby/gems/1.8/gems/logstash-0.2.20101208111718/lib/logstash/web/server.
rb:39: warning: parenthesize argument(s) for future version
/usr/lib/ruby/gems/1.8/gems/logstash-0.2.20101208111718/lib/logstash/web/server.
rb:43: warning: parenthesize argument(s) for future version
/usr/lib/ruby/gems/1.8/gems/logstash-0.2.20101208111718/lib/logstash/web/server.
rb:54: warning: parenthesize argument(s) for future version
/usr/lib/ruby/gems/1.8/gems/logstash-0.2.20101208111718/lib/logstash/web/server.
rb:99: warning: parenthesize argument(s) for future version
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/utils.rb:138:in `union': can't 
convert Array into String (TypeError)
        from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/utils.rb:138
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/request.rb:1
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/showexceptions.rb:3
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
         ... 12 levels...
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/gems/1.8/gems/logstash-0.2.20101208111718/bin/logstash-web:6
        from /usr/bin/logstash-web:19:in `load'
        from /usr/bin/logstash-web:19

I downgraded to 1.1.0 ie.

gem install rack --version 1.1.0

Now it 

$ logstash-web
/usr/lib/ruby/gems/1.8/gems/logstash-0.2.20101208111718/lib/logstash/web/server.
rb:27: warning: parenthesize argument(s) for future version
/usr/lib/ruby/gems/1.8/gems/logstash-0.2.20101208111718/lib/logstash/web/server.
rb:39: warning: parenthesize argument(s) for future version
/usr/lib/ruby/gems/1.8/gems/logstash-0.2.20101208111718/lib/logstash/web/server.
rb:43: warning: parenthesize argument(s) for future version
/usr/lib/ruby/gems/1.8/gems/logstash-0.2.20101208111718/lib/logstash/web/server.
rb:54: warning: parenthesize argument(s) for future version
/usr/lib/ruby/gems/1.8/gems/logstash-0.2.20101208111718/lib/logstash/web/server.
rb:99: warning: parenthesize argument(s) for future version
>> Thin web server (v1.2.7 codename No Hup)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:9292, CTRL+C to stop

Original issue reported on code.google.com by hrvatska...@gmail.com on 9 Dec 2010 at 3:24

GoogleCodeExporter commented 9 years ago
I think this is/was a bug in async_sinatra/thin/rack. I'll try to reproduce and 
will get back to you.

Original comment by jls.semi...@gmail.com on 6 Jan 2011 at 7:08

GoogleCodeExporter commented 9 years ago
The line of code this is barfing on, in Rack-1.2.1, is this:

{{{
    ESCAPE_HTML_PATTERN = Regexp.union(ESCAPE_HTML.keys)
}}}

I think ruby 1.8.6 doesn't have Regexp#union

Original comment by jls.semi...@gmail.com on 18 Jan 2011 at 6:21

GoogleCodeExporter commented 9 years ago
From: http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/NEWS

  * Regexp.union accepts an array of patterns.

Original comment by jls.semi...@gmail.com on 18 Jan 2011 at 6:22

GoogleCodeExporter commented 9 years ago
Should be fixed. Tested with Ruby 1.8.6-p399 compiled by rvm.

Code: 
https://github.com/logstash/logstash/blob/master/lib/logstash/rubyfixes/regexp_u
nion_takes_array.rb

Example:
{{{
% rvm 1.8.6 gem list rack        
rack (1.2.1)

% rvm 1.8.6 exec bin/logstash-web
/home/jls/projects/logstash/bin/../lib/logstash/web/server.rb:27: warning: 
parenthesize argument(s) for future version
/home/jls/projects/logstash/bin/../lib/logstash/web/server.rb:42: warning: 
parenthesize argument(s) for future version
/home/jls/projects/logstash/bin/../lib/logstash/web/server.rb:45: warning: 
parenthesize argument(s) for future version
/home/jls/projects/logstash/bin/../lib/logstash/web/server.rb:48: warning: 
parenthesize argument(s) for future version
/home/jls/projects/logstash/bin/../lib/logstash/web/server.rb:89: warning: 
parenthesize argument(s) for future version
/home/jls/projects/logstash/bin/../lib/logstash/web/server.rb:134: warning: 
parenthesize argument(s) for future version
>> Thin web server (v1.2.7 codename No Hup)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:9292, CTRL+C to stop
}}}

This is now fixed in master and will show up in the next release (undetermined 
date).  If you need it sooner please let me know.

Original comment by jls.semi...@gmail.com on 18 Jan 2011 at 6:48