我正在阅读Ruby on Rails教程的第6章:Michael Hartl的示例学习Rails。
关注these instructions in 6.3.1 (Debug and Rails environments)后,我将此行添加到 app / views / layouts / application.html.erb :
<%= debug(params) if Rails.env.development? %>
但是,我得到的调试输出与this part of Ch 6.3.3 (A Users resource)上显示的输出不同。
我本地Rails服务器的调试输出:
---
action: show
controller: users
id: '1'
书中的调试输出:
--- !map:ActiveSupport::HashWithIndifferentAccess
action: show
controller: users
id: "1"
是否有任何关于它为何失踪的直接想法?我仔细检查了我对书的所有文件,它们看起来完全相同。如果有帮助,我正在执行以下操作:
Ruby版本:
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
宝石列表:
*** 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)
activerecord (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)
平台:
Mac OS X 10.6.6(Snow Leopard)
答案 0 :(得分:0)
不要担心它 - 输出两次都是映射,键和值是相同的。返回的确切类别并不重要。作者最有可能使用了这个或那个宝石的略有不同的版本。