This project is archived and is in readonly mode.
[PATCH] Rails3 application named 'Test' fails webrick with uninitialized constant Rack::Test::Application
Reported by MOE | February 6th, 2010 @ 06:05 AM | in 3.0.2
Webrick fails with rescue in load_missing_constant':
uninitialized constant Rack::Test::Application (NameError) if
application is named 'Test'. Stack trace:
moe@ingrid:/tmp/Test$ rails server
=> Booting WEBrick
=> Rails 3.0.0.beta application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/var/lib/gems/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:456:in `rescue in load_missing_constant': uninitialized constant Rack::Test::Application (NameError)
from /var/lib/gems/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:452:in `load_missing_constant'
from /var/lib/gems/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:91:in `const_missing_with_dependencies'
from config.ru:4:in `block in '
from /var/lib/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
from /var/lib/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `'
from /var/lib/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:35:in `eval'
from /var/lib/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:35:in `parse_file'
from /var/lib/gems/1.9.1/gems/rack-1.1.0/lib/rack/server.rb:113:in `app'
from /var/lib/gems/1.9.1/gems/rack-1.1.0/lib/rack/server.rb:189:in `wrapped_app'
from /var/lib/gems/1.9.1/gems/rack-1.1.0/lib/rack/server.rb:155:in `start'
from /var/lib/gems/1.9.1/gems/railties-3.0.0.beta/lib/rails/commands/server.rb:49:in `start'
from /var/lib/gems/1.9.1/gems/rack-1.1.0/lib/rack/server.rb:83:in `start'
from /var/lib/gems/1.9.1/gems/railties-3.0.0.beta/lib/rails/commands.rb:39:in `'
from /tmp/Test/script/rails:10:in `require'
from /tmp/Test/script/rails:10:in `'
I guess this should be somehow mentioned at docs...
Comments and changes to this ticket
-
MOE February 6th, 2010 @ 06:22 AM
- Tag set to rails 3.0, rack, server, webrick
-
José Valim February 6th, 2010 @ 10:05 AM
Could you please provide a patch to update the docs then? Thanks.
-
Kieran P February 6th, 2010 @ 06:53 PM
It might be worth adding a check to see if the constant is already defined in the current app, i.e.
raise "Already used" if defined?(APP_NAME)
-
José Valim February 6th, 2010 @ 06:56 PM
It's more complicated than that. In this case, it's failing due to Rack::Test. And defined?(Test) wouldn't get it.
-
Kieran P February 6th, 2010 @ 07:58 PM
- Title changed from Rails3 application named 'Test' fails webrick with uninitialized constant Rack::Test::Application to [PATCH] Rails3 application named 'Test' fails webrick with uninitialized constant Rack::Test::Application
Right, but checking to make sure things like String or Module aren't used would be a good start.
I've attached a patch +tests to do this.
-
ecleel March 4th, 2010 @ 11:14 PM
- Tag changed from rails 3.0, rack, server, webrick to rails 3.0, rack, server, thin
Thin webserver gives me same problem.
thin -v = 1.2.7
-
ecleel March 4th, 2010 @ 11:14 PM
- Tag changed from rails 3.0, rack, server, thin to rails 3.0, rack, server, thin, webrick
-
José Valim March 5th, 2010 @ 07:09 AM
- Milestone cleared.
- Assigned user set to José Valim
-
José Valim March 12th, 2010 @ 08:25 PM
- State changed from new to committed
Thanks Kieran. Committed.
-
Repository March 12th, 2010 @ 08:34 PM
(from [9268b598bb20523e1b886f8811598647ce427ef9]) Add a check to ensure that the application name does not already exist, i.e. String or Module are part of ruby [#3872 status:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/9268b598bb20523e1b886f88115986... -
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 3872 [PATCH] Rails3 application named 'Test' fails webrick with uninitialized constant Rack::Test::Application (from [9268b598bb20523e1b886f8811598647ce427ef9]) Add a c...