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

rack 1.2.1/sinatra 1.0 crash on windows #32

Closed
damphyr opened this issue Jun 23, 2010 · 3 comments
Closed

rack 1.2.1/sinatra 1.0 crash on windows #32

damphyr opened this issue Jun 23, 2010 · 3 comments

Comments

@damphyr
Copy link

damphyr commented Jun 23, 2010

Requiring sinatra (which pulls rack) results in the following on Windows XP

C:\temp>ruby test.rb
C:/dev/ruby/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 C:/dev/ruby/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/utils.rb:138 from C:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
from C:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' from C:/dev/ruby/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/request.rb:1 from C:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
from C:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' from C:/dev/ruby/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/showexceptions.rb:3 from C:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
... 7 levels...
from C:/dev/ruby/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra.rb:4
from C:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' from C:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire'
from test.rb:1

Tested with the newest RubyInstaller and the last OneClickInstaller with all gems updated to 23.06.2010.
test.rb is just one line: require 'sinatra'

Problem does not exist on Mac OS X with the standard Apple Ruby.
Reverting to rack 1.0.1 solves the problem.

@raggi
Copy link
Member

raggi commented Jun 23, 2010

Use ruby 1.8.7 or see the patch here: http://github.com/rack/rack/commit/bf4593a5cf61aa9cb0715e6e9794a01a514ea199

@rvalle
Copy link

rvalle commented Oct 19, 2010

..well I am having the same issue with 1.8.7

/var/lib/hudson/.rvm/gems/ruby-1.8.7-p302@celpax_gems/gems/rack-1.2.1/lib/rack/utils.rb:138:in `union': can't convert Array into String (TypeError)
from /var/lib/hudson/.rvm/gems/ruby-1.8.7-p302@celpax_gems/gems/rack-1.2.1/lib/rack/utils.rb:138

@chetankumar
Copy link

Line 138 of utils.rb has this :

Regexp.union(ESCAPE_HTML.keys)

I changed it to :
Regexp.union(ESCAPE_HTML.keys.join(','))

and it worked.

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

No branches or pull requests

4 participants