tratando de actualizar desde ruby ​​1.8.7 a 1.9.2 sin dejar de usar los Rails 2.3.8

cuando hago paquete exec script / server -p3001, obtengo el siguiente error / stacktrace = (

/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:142:in `module_eval': (eval):1: syntax error, unexpected '{', expecting ';' or '\n' (SyntaxError) def hash_for_{:build=>[:get, :post]}_templa... ^ from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:142:in `named_helper_module_eval' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:152:in `define_hash_access' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:136:in `block in define_named_route_methods' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:134:in `each' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:134:in `define_named_route_methods' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:85:in `add' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:318:in `add_named_route' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:33:in `named_route' from [rvm-gemset-location]/gems/activesupport-2.3.8/lib/active_support/option_merger.rb:20:in `method_missing' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:654:in `map_resource_routes' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:606:in `map_default_collection_actions' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:536:in `block in map_resource' from [rvm-gemset-location]/gems/activesupport-2.3.8/lib/active_support/core_ext/object/misc.rb:78:in `with_options' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:528:in `map_resource' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:447:in `block in resources' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:447:in `each' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:447:in `resources' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:581:in `map_has_many_associations' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:578:in `block in map_has_many_associations' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:577:in `each' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:577:in `map_has_many_associations' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:560:in `map_associations' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:529:in `block in map_resource' from [rvm-gemset-location]/gems/activesupport-2.3.8/lib/active_support/core_ext/object/misc.rb:78:in `with_options' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:528:in `map_resource' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:447:in `block in resources' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:447:in `each' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/resources.rb:447:in `resources' from[project directory]/config/routes.rb:45:in `block in ' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:227:in `draw' from[project directory]/config/routes.rb:1:in `' from [rvm-gemset-location]/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in `load' from [rvm-gemset-location]/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in `block in load_with_new_constant_marking' from [rvm-gemset-location]/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in' from [rvm-gemset-location]/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in `load_with_new_constant_marking' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:287:in `block in load_routes!' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:287:in `each' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:287:in `load_routes!' from [rvm-gemset-location]/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:267:in `load!' from [rvm-gemset-location]/gems/rails-2.3.8/lib/initializer.rb:537:in `initialize_routing' from [rvm-gemset-location]/gems/rails-2.3.8/lib/initializer.rb:188:in `process' from [rvm-gemset-location]/gems/rails-2.3.8/lib/initializer.rb:113:in `run' from[project directory]/config/environment.rb:19:in `' from [rvm-gemset-location]/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require' from [rvm-gemset-location]/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `block in require' from [rvm-gemset-location]/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in' from [rvm-gemset-location]/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require' from[project directory]/config.ru:3:in `block in ' from [rvm-gemset-location]/gems/rack-1.1.3/lib/rack/builder.rb:46:in `instance_eval' from [rvm-gemset-location]/gems/rack-1.1.3/lib/rack/builder.rb:46:in `initialize' from[project directory]/config.ru:1:in `new' from[project directory]/config.ru:1:in `' from [rvm-gemset-location]/gems/rails-2.3.8/lib/commands/server.rb:78:in `eval' from [rvm-gemset-location]/gems/rails-2.3.8/lib/commands/server.rb:78:in `' from script/server:3:in `require' from script/server:3:in `' 

¿Cómo puedo arreglar esto? Quiero decir, la syntax a la que apunta es realmente extraña … pero esto funcionó en 1.8.7 = \

Compruebe la syntax, tuve un problema similar:

 syntax error, unexpected '{', expecting ';' or '\n' (SyntaxError) def hash_for_{:create=>:post, :delete=>:pos... 

donde estaba enviando una matriz para la clave de colección: en lugar de un hash en el archivo route.rb. Así que tuve esto:

 :collection => [ :next => :get, :prev => :get, :sort => :post ] 

y cambiado a:

 :collection => { :next => :get, :prev => :get, :sort => :post } 

Espero que esto ayude…