Forum: Rails-ES Problemas con Globalize y rutas

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5c15703984caa012845b3cea129da936?d=identicon&s=25 Manuel González Noriega (Guest)
on 2007-01-19 16:31
(Received via mailing list)
Hola,

estoy recibiendo el siguiente error cuando altero routes.rb para
integrar Globalize.

ERROR MSG ---
** Starting Rails in environment development ...
Exiting
./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:267:in
`load_missing_constant': uninitialized constant Locale (NameError)
        from
./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:453:in
`const_missing'
        from
./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:465:in
`const_missing'
        from ./script/../config/../config/routes.rb:21
        from
./script/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1126:in
`draw'
        from ./script/../config/../config/routes.rb:1
        from
./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in
`load'
        from
./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:343:in
`new_constants_in'
        from
./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in
`load'
         ... 24 levels...
        from
./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:343:in
`new_constants_in'
        from
./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in
`require'
        from
./script/../config/../vendor/rails/railties/lib/commands/server.rb:39
        from script/server:3
FIN ERROR MSG ---


En environment.rb inicializo Globalize de esta forma

---
include Globalize
Locale.set_base_language 'es-ES'
LOCALES = {'en' => 'en-US'}.freeze
---

y en routes.rb

---
# Allow downloading Web Service WSDL as a file with an extension
  # instead of a file named 'wsdl'
  map.connect ':controller/service.wsdl', :action => 'wsdl'

  # Install the default route as the lowest priority.
  map.connect ':language/:controller/:action/:id', :defaults => {
:language => Locale.language ? Locale.language.code : 'es', :id => nil
}
  map.connect ':controller/:action/:id.:format'
  map.connect ':controller/:action/:id'
---


¿Sugerencias? ¡Gracias de antemano!

--
Manuel
http://linkja.com * un agregador de tendencias
http://simplelogica.net
http://simplelogica.net/logicola
This topic is locked and can not be replied to.