Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

uninitialized constant Rack::Mount::Const on Ruby 1.9.2 (AWDwR3, section 12.1)

#3469

Scenario:
1. Start server
2. ruby script/generate controller info who_bought
3. curl --silent http://localhost:3000/info/who_bought/3

Even in development mode, a server restart is normally required in order to "see" this route (see ticket #3407 Server restart required after generate controller), but even so, the response should be No route matches "/info/who_bought/" instead of a stack traceback.

Problem occurs when rack-mount with the following commit or later:

commit 90fcd5eb7731b8c799add504de96b58db267dd8a
Author: Joshua Peek <josh@joshpeek.com>
Date:   Sat Nov 7 15:26:05 2009 -0500

    dismantle Const

Problem occurs on Ruby 1.9.2, but not on Ruby 1.8.7.

Symptoms:

/home/rubys/git/awdwr/work/depot/vendor/rails/activesupport/lib/active_support/dependencies.rb:456:in rescue in load_missing_constant'
/home/rubys/git/awdwr/work/depot/vendor/rails/activesupport/lib/active_support/dependencies.rb:452:inload_missing_constant'
/home/rubys/git/awdwr/work/depot/vendor/rails/activesupport/lib/active_support/dependencies.rb:91:in const_missing_with_dependencies'
/home/rubys/git/awdwr/work/depot/vendor/rails/actionpack/lib/action_dispatch/routing/route_set.rb:8:inblock in &lt;class:RouteSet&gt;'
/home/rubys/git/rack-mount/lib/rack/mount/recognition/code_generation.rb:63:in call'
/home/rubys/git/rack-mount/lib/rack/mount/recognition/code_generation.rb:63:inoptimized_each'
/home/rubys/git/rack-mount/lib/rack/mount/recognition/code_generation.rb:94:in call'
/home/rubys/git/awdwr/work/depot/vendor/rails/actionpack/lib/action_dispatch/routing/route_set.rb:392:incall'
/home/rubys/git/awdwr/work/depot/vendor/rails/actionpack/lib/action_dispatch/middleware/string_coercion.rb:25:in call
/home/rubys/.rvm/gems/ruby/1.9.1/gems/rack-1.0.1/lib/rack/head.rb:9:incall'
/home/rubys/.rvm/gems/ruby/1.9.1/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in call'
/home/rubys/git/awdwr/work/depot/vendor/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:19:incall'
/home/rubys/git/awdwr/work/depot/vendor/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in call'
/home/rubys/git/awdwr/work/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:inblock in call'
/home/rubys/git/awdwr/work/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in cache'
/home/rubys/git/awdwr/work/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:incache
/home/rubys/git/awdwr/work/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in call'
/home/rubys/git/awdwr/work/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:365:incall'
/home/rubys/git/awdwr/work/depot/vendor/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in block in call'
/home/rubys/git/awdwr/work/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:428:in_run_call_callbacks'
/home/rubys/git/awdwr/work/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:87:in run_callbacks'
/home/rubys/git/awdwr/work/depot/vendor/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:incall'
/home/rubys/git/awdwr/work/depot/vendor/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:47:in call'
/home/rubys/.rvm/gems/ruby/1.9.1/gems/rack-1.0.1/lib/rack/lock.rb:11:inblock in call'
<internal:prelude>;:8:in synchronize'</code>
</pre>


Full details here: http://intertwingly.net/projects/AWDwR3/checkdepot-rvm-1.9.2.html#s...

Reported by Sam Ruby · November 8th, 2009 @ 11:35 AM

State: invalid
Milestone: none
Assigned to: josh josh
Importance: none

Activity

  1. josh
    josh
    • State changed from new to invalid

    Rackmount edge has not been tested on rails yet.

    Your scripts should be pulling from "git://github.com/rails/rack-mount.git" which is the "stable" rails version of rackmount.

    I know a few places in rails reference Const which I removed, don't know how it didn't break on 1.8.7. Thanks for the heads up though.

    November 8th, 2009 @ 03:44 PM