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.

request.inspect does not work in ruby 1.9.2

#6541

When I use request.inspect in controller, integration tests fail with following stack trace in log file:

# Logfile created on 2011-03-07 19:38:24 +0100

Processing PostsController#index (for 127.0.0.1 at 2011-03-07 19:38:25) [GET]

RuntimeError (can't add a new key into hash during iteration):
  app/controllers/posts_controller.rb:5:in `inspect'
  app/controllers/posts_controller.rb:5:in `inspect'
  app/controllers/posts_controller.rb:5:in `index'
  <internal:prelude>:10:in `synchronize'
  test/integration/general_stories_test.rb:8:in `block in <class:GeneralStoriesTest>'
  /home/jarl/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/minitest/unit.rb:680:in `run'
  /home/jarl/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/minitest/unit.rb:641:in `block (2 levels) in run_test_suites'
  /home/jarl/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/minitest/unit.rb:635:in `each'
  /home/jarl/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/minitest/unit.rb:635:in `block in run_test_suites'
  /home/jarl/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/minitest/unit.rb:634:in `each'
  /home/jarl/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/minitest/unit.rb:634:in `run_test_suites'
  /home/jarl/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/minitest/unit.rb:594:in `run'
  /home/jarl/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/minitest/unit.rb:492:in `block in autorun'

Rendered rescues/_trace (66.6ms)
Rendered rescues/_request_and_response (1.6ms)
Rendering rescues/layout (internal_server_error)

I will link to a small github project soon

Reported by Jarl Friis · March 7th, 2011 @ 08:34 PM

State: new
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Jarl Friis
    Jarl Friis
    • Tag changed from rails 2., rails 2.3.11, 2.3-stable, 2.3.x, rails_2_3_stable, ruby-1.9.2, ruby-192, ruby1.9, ruby1.9.2, ruby1.9.2-p136, ruby19, ruby192 to rails 2., rails 2.3.11, 2.3-stable, 2.3.x, actioncontroller::request, rails_2_3_stable, ruby-1.9.2, ruby-192, ruby1.9, ruby1.9.2, ruby1.9.2-p136, ruby19, ruby192

    I have created a small github project that demonstrates the bug on https://github.com/jarl-dk/rails_ticket6541

    the project is created with

    rails rails_ticket6541
    cd rails_ticket6541
    ./script generate scaffold post
    ./script generate integration_test GeneralStories
    

    And then applied commit 5c0531783142132a285cb4330c5710308239d3a7

    It is interesting to note that only the integration test fails, not the functional test.
    Note also that it only fails with ruby 1.9.2 (not ruby 1.8.x)

    Jarl

    March 7th, 2011 @ 09:26 PM

  2. Jarl Friis
    Jarl Friis
    • Tag changed from rails 2., rails 2.3.11, 2.3-stable, 2.3.x, actioncontroller::request, rails_2_3_stable, ruby-1.9.2, ruby-192, ruby1.9, ruby1.9.2, ruby1.9.2-p136, ruby19, ruby192 to rails 2., rails 2.3.11, 2.3-stable, 2.3.x, actioncontroller::request, rails_2_3_stable, request, ruby-1.9.2, ruby-192, ruby1.9, ruby1.9.2, ruby1.9.2-p136, ruby19, ruby192

    March 7th, 2011 @ 09:27 PM

  3. Jarl Friis
    Jarl Friis
    • Tag changed from rails 2., rails 2.3.11, 2.3-stable, 2.3.x, actioncontroller::request, rails_2_3_stable, request, ruby-1.9.2, ruby-192, ruby1.9, ruby1.9.2, ruby1.9.2-p136, ruby19, ruby192 to rails 2., rails 2.3.11, 2.3-stable, 2.3.x, abstract_store.rb, abstract_storerb, actioncontroller::request, cookie-store, cookiestore, cookie_store, rails_2_3_stable, request, ruby-1.9.2, ruby-192, ruby1.9, ruby1.9.2, ruby1.9.2-p136, ruby19, ruby192

    I forgot to mention... When start the server with ./script/server and hit http://localhost:3000/posts, I get

    /home/jarl/.rvm/gems/ruby-1.9.2-p136@minimal/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:155:in `[]='
    /home/jarl/.rvm/gems/ruby-1.9.2-p136@minimal/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:155:in `unpacked_cookie_data'
    /home/jarl/.rvm/gems/ruby-1.9.2-p136@minimal/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:138:in `extract_session_id'
    /home/jarl/.rvm/gems/ruby-1.9.2-p136@minimal/gems/actionpack-2.3.11/lib/action_controller/session/abstract_store.rb:36:in `load_session_id!'
    /home/jarl/.rvm/gems/ruby-1.9.2-p136@minimal/gems/actionpack-2.3.11/lib/action_controller/session/abstract_store.rb:24:in `[]'
    /home/jarl/.rvm/gems/ruby-1.9.2-p136@minimal/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:147:in `current_session_id'
    /home/jarl/.rvm/gems/ruby-1.9.2-p136@minimal/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:151:in `exists?'
    /home/jarl/.rvm/gems/ruby-1.9.2-p136@minimal/gems/actionpack-2.3.11/lib/action_controller/session/abstract_store.rb:107:in `exists?'
    /home/jarl/.rvm/gems/ruby-1.9.2-p136@minimal/gems/actionpack-2.3.11/lib/action_controller/session/abstract_store.rb:124:in `load_for_read!'
    /home/jarl/.rvm/gems/ruby-1.9.2-p136@minimal/gems/actionpack-2.3.11/lib/action_controller/session/abstract_store.rb:101:in `inspect'
    /home/jarl/Private/nokia/projects/bug_demo/app/controllers/posts_controller.rb:6:in `inspect'
    /home/jarl/Private/nokia/projects/bug_demo/app/controllers/posts_controller.rb:6:in `inspect'
    /home/jarl/Private/nokia/projects/bug_demo/app/controllers/posts_controller.rb:6:in `index'
    

    March 8th, 2011 @ 07:19 AM