Skip to content
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

added String#b method #2327

Merged
merged 1 commit into from
Dec 16, 2014
Merged

Conversation

jkutner
Copy link
Member

@jkutner jkutner commented Dec 15, 2014

This missing method is a problem for simple WEBrick apps. For example:

$ cat config.ru
ruby_info = `ruby -v`
run Proc.new {|env| [200, {"Content-Type" => "text/plain"}, [ruby_info]]}

$ JRUBY_OPTS=--2.0 bundle exec backup
file:/Users/jkutner/.rvm/rubies/jruby-1.7.17/lib/jruby.jar!/jruby/kernel19/kernel.rb:28 warning: unsupported exec option: close_others
[2014-12-15 17:04:48] INFO  WEBrick 1.3.1
[2014-12-15 17:04:48] INFO  ruby 2.0.0 (2014-12-09) [java]
[2014-12-15 17:04:48] INFO  WEBrick::HTTPServer#start: pid=24489 port=9292
[2014-12-15 17:05:06] ERROR bad URI `/'.
[2014-12-15 17:05:06] ERROR NoMethodError: undefined method `b' for "Bad Request":String
    /Users/jkutner/.rvm/rubies/jruby-1.7.17/lib/ruby/2.0/webrick/htmlutils.rb:19:in `escape'
    /Users/jkutner/.rvm/rubies/jruby-1.7.17/lib/ruby/2.0/webrick/httpresponse.rb:356:in `set_error'
    /Users/jkutner/.rvm/rubies/jruby-1.7.17/lib/ruby/2.0/webrick/httpserver.rb:99:in `run'
    /Users/jkutner/.rvm/rubies/jruby-1.7.17/lib/ruby/2.0/webrick/server.rb:295:in `start_thread'

This shouldn't be used by any one in production -- I only ran into it during a test. But I guess it could happen for someone trying to get started with JRuby

headius added a commit that referenced this pull request Dec 16, 2014
@headius headius merged commit e6150c6 into jruby:jruby-1_7 Dec 16, 2014
@headius
Copy link
Member

headius commented Dec 16, 2014

Thank you!

@fun-ruby
Copy link

I am seeing this too after upgrading to 1.7.17. Looking forward to this fix. In the mean time can get by with Ruby 1.9.3 compat, by removing compat.version=2.0 in .jrubyrc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants