Rake aborted! can't convert Hash into String

Hello,

I encouter a problem when i try to do “rake db:migrate”:
rake aborted!
can’t convert Hash into String

Here is the trace result:

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
can’t convert Hash into String
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1408:in
directory?' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1408:infu_each_src_dest0’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1393:in
fu_each_src_dest' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:494:inmove’
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1094:in move' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/option_merger.rb:20:insend
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/option_merger.rb:20:in
method_missing' /Users/lina/ruby/trunk/config/routes.rb:58 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/object/misc.rb:78:inwith_options’
/Users/lina/ruby/trunk/config/routes.rb:53
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:226:in
draw' /Users/lina/ruby/trunk/config/routes.rb:1 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:inload_without_new_constant_marking’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in
load' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:innew_constants_in’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in
load' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:286:inload_routes!’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:286:in
each' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:286:inload_routes!’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:266:in
reload!' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:537:ininitialize_routing’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:188:in
process' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:insend’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in
run' /Users/lina/ruby/trunk/config/environment.rb:18 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:ingem_original_require’
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in require' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
new_constants_in' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/misc.rake:4
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in call' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:inexecute’
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in each' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:inexecute’
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
invoke_with_call_chain' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:insynchronize’
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
invoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:ininvoke_prerequisites’
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in each' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:ininvoke_prerequisites’
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in
invoke_with_call_chain' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:insynchronize’
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
invoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:ininvoke’
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in invoke_task' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level’
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in each' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level’
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:intop_level’
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in run' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling’
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in run' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:inload’
/usr/bin/rake:19

Does anyone meet this problem before? Thanks!

On Jan 19, 2:42pm, Na Li [email protected] wrote:

Hello,

I encouter a problem when i try to do “rake db:migrate”:
rake aborted!
can’t convert Hash into String

looks like it’s blowing up trying to load your routes.rb file

Fred

Frederick C. wrote in post #976017:

On Jan 19, 2:42pm, Na Li [email protected] wrote:

Hello,

I encouter a problem when i try to do “rake db:migrate”:
rake aborted!
can’t convert Hash into String

looks like it’s blowing up trying to load your routes.rb file

Fred

Thanks for your reply. Any idea what could be the reason?

Jian J. wrote in post #976018:

Frederick C. wrote in post #976017:

On Jan 19, 2:42pm, Na Li [email protected] wrote:

Hello,

I encouter a problem when i try to do “rake db:migrate”:
rake aborted!
can’t convert Hash into String

looks like it’s blowing up trying to load your routes.rb file

Fred

Thanks for your reply. Any idea what could be the reason?

Well, what’s on those lines in the routes file that it’s complaining
about? Is there something inappropriate going on with a Hash?

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On Jan 19, 4:03pm, Jian J. [email protected] wrote:

In routes.rb file, here are the corresponding lines:
Line 1: ActionController::Routing::Routes.draw do |map|
Line 53: map.with_options(:controller => “item”, :conditions =>{:method
=> :put}) do |m|
Line 58: m.move
‘/item/move/:relation_type/:item_type/:item_id/:source_type/:source_id/:des
t_type/:dest_id.:format’,
:action => ‘move’

I don’t think there is anything to do with Hash in those code…

it looks (as a guess) that the call to move, instead of tumbling
through to method_missing and created a named_route is calling a
method defined by rake. Does changing the name of the route make any
difference?

Fred

In routes.rb file, here are the corresponding lines:
Line 1: ActionController::Routing::Routes.draw do |map|
Line 53: map.with_options(:controller => “item”, :conditions =>{:method
=> :put}) do |m|
Line 58: m.move
‘/item/move/:relation_type/:item_type/:item_id/:source_type/:source_id/:dest_type/:dest_id.:format’,
:action => ‘move’

I don’t think there is anything to do with Hash in those code…

Marnen Laibow-Koser wrote in post #976021:

Jian J. wrote in post #976018:

Frederick C. wrote in post #976017:

On Jan 19, 2:42pm, Na Li [email protected] wrote:

Hello,

I encouter a problem when i try to do “rake db:migrate”:
rake aborted!
can’t convert Hash into String

looks like it’s blowing up trying to load your routes.rb file

Fred

Thanks for your reply. Any idea what could be the reason?

Well, what’s on those lines in the routes file that it’s complaining
about? Is there something inappropriate going on with a Hash?

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Frederick C. wrote in post #976032:

On Jan 19, 4:03pm, Jian J. [email protected] wrote:

In routes.rb file, here are the corresponding lines:
Line 1: ActionController::Routing::Routes.draw do |map|
Line 53: map.with_options(:controller => “item”, :conditions =>{:method
=> :put}) do |m|
Line 58: m.move
‘/item/move/:relation_type/:item_type/:item_id/:source_type/:source_id/:des
t_type/:dest_id.:format’,
:action => ‘move’

I don’t think there is anything to do with Hash in those code…

it looks (as a guess) that the call to move, instead of tumbling
through to method_missing and created a named_route is calling a
method defined by rake. Does changing the name of the route make any
difference?

Fred

Thanks for all the replies. It turns out there is something wrong with
the line 58 in routes.rb. So i commented this line, and it works:-)

Thank you all.