This project is archived and is in readonly mode.

#6541 new
Jarl Friis

request.inspect does not work in ruby 1.9.2

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

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

Comments and changes to this ticket

  • Jarl Friis

    Jarl Friis March 7th, 2011 @ 09:26 PM

    • 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

  • Jarl Friis

    Jarl Friis March 7th, 2011 @ 09:27 PM

    • 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
  • Jarl Friis

    Jarl Friis March 8th, 2011 @ 07:19 AM

    • 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'
    

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

People watching this ticket

Pages