Can't convert Hash into String. (TypeError) #19

greenail opened this Issue Sep 27, 2012 · 3 comments


None yet
3 participants

is there issues with different version of ruby? I've tried on linux and windows with 1.9.3, 1.9.2 and 1.8.7 and get this error when i run: rake test

c:/Ruby193/lib/ruby/gems/1.9.1/gems/addressable-2.3.2/lib/addressable/uri.rb:340:in `rescue in encode_component': Can't convert Hash into String. (TypeError)

Edit: confirmed that putting the addressable version in the Gemfile fixes it

gem 'addressable' , '~> 2.2.8'


Xylakant commented Sep 28, 2012

Thanks for the report. See #18 and the linked discussion in the adressable bugtracker. I'll close this one since it's already tracked.

Xylakant closed this Sep 28, 2012

The issue should be opened again. I think the problem is defiantly in query_values method.

Framework trace:
addressable (2.3.4) lib/addressable/uri.rb:350:in rescue in encode_component' addressable (2.3.4) lib/addressable/uri.rb:340:inencode_component'
addressable (2.3.4) lib/addressable/uri.rb:1565:in block in query_values=' addressable (2.3.4) lib/addressable/uri.rb:1551:ineach'
addressable (2.3.4) lib/addressable/uri.rb:1551:in `query_values='

My code:
require 'addressable/uri'
@review_params =
t = {"reviews" =>{ 'title' => 'newtitle', 'text' => 'huge big text'}};
@review_params.query_values = t //here's the problem


Xylakant commented Jun 2, 2013

The dependency on addressable was removed in 0.6.3 [1]. So while the issue still exists in addressable it does not affect us any more. See #18 and #20 for more details on the matter.

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