开发者

"!map:ActiveSupport::HashWithIndifferentAccess" does not appear in page debug info

开发者 https://www.devze.com 2023-03-14 04:53 出处:网络
I\'m on Chapter 6 of the Ruby on Rails Tutorial: Learn Rails by Example by Michael Hartl. Following these instructions in 6.3.1 (Debug and Rails environments), I added this line to app/views/layouts/

I'm on Chapter 6 of the Ruby on Rails Tutorial: Learn Rails by Example by Michael Hartl.

Following these instructions in 6.3.1 (Debug and Rails environments), I added this line to app/views/layouts/application.html.erb:

<%= debug(params) if Rails.env.development? %>

However, I am getting a different debug output than the one shown on this part of Ch 6.3.3 (A Users resource).

The debug output from my local Rails server:

---
action: show
controller: users
id: '1'

The debug output in the book:

--- !map:ActiveSupport::HashWithIndifferentAccess
action: show
controller: users
id: "1"

Any immediate thoughts as to why it's missing? I double checked all of my files against the book, and they seem identical. If it helps, I'm running the following:

Ruby version:

ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0]

Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.0.9'
gem 'sqlite3', '1.3.3'

group :development do
  gem 'rspec-rails', '2.6.1'
  gem 'annotate-models', '1.0.4'
end

group :test do
  gem 'rspec-rails', '2.6.1'
  gem 'webrat', '0.7.1'
  gem 'spork', '0.9.0.rc8'
  gem 'autotest', '4.4.6'
  gem 'autotest-rails-pure', '4.1.2'
  gem 'autotest-fsevent', '0.2.4'
  gem 'autotest-growl', '0.2.9'
end

Gem list:

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.9, 3.0.8)
actionpack (3.0.9, 3.0.8)
activemodel (3.0.9, 3.0.8)
activere开发者_开发技巧cord (3.0.9, 3.0.8)
activeresource (3.0.9, 3.0.8)
activesupport (3.0.9, 3.0.8)
annotate-models (1.0.4)
arel (2.0.10)
autotest (4.4.6)
autotest-fsevent (0.2.4)
autotest-growl (0.2.9)
autotest-rails-pure (4.1.2)
builder (2.1.2)
bundler (1.0.15)
configuration (1.2.0)
diff-lcs (1.1.2)
erubis (2.6.6)
heroku (2.3.0)
i18n (0.5.0)
launchy (0.4.0)
mail (2.2.19)
mime-types (1.16)
nokogiri (1.4.5)
polyglot (0.3.1)
rack (1.2.3)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.9, 3.0.8)
railties (3.0.9, 3.0.8)
rake (0.9.2, 0.8.7)
rdoc (3.6.1)
rest-client (1.6.3)
rspec (2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
rspec-mocks (2.6.0)
rspec-rails (2.6.1)
sequel (3.20.0)
sinatra (1.0)
spork (0.9.0.rc8)
sqlite3 (1.3.3)
sqlite3-ruby (1.3.3)
sys-uname (0.8.5)
taps (0.3.23)
term-ansicolor (1.0.5)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.28)
webrat (0.7.1)
ZenTest (4.5.0)

Platform:

Mac OS X 10.6.6 (Snow Leopard)


Don't fret about it - the output both times is a mapping and the keys and values are the same. The exact class returned doesn't matter so much. It's most likely that the author used a slightly different version of this or that gem.

0

精彩评论

暂无评论...
验证码 换一张
取 消