我进入第6步)与您的服务器交谈,我打算添加<%= @ request.query.inspect%>
当我运行$ ruby page_generator_with_layout.rb
时我收到此错误
- Converting .html.erb to html with Layout !!!
(erb):14:in `process_erb': undefined method `query' for nil:NilClass (NoMethodError)
from /Users/Jupitor/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/erb.rb:838:in `eval'
from /Users/Jupitor/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/erb.rb:838:in `result'
from page_generator_with_layout.rb:6:in `process_erb'
from page_generator_with_layout.rb:24:in `block in <main>'
from page_generator_with_layout.rb:13:in `each'
from page_generator_with_layout.rb:13:in `<main>'
答案 0 :(得分:1)
您不再需要运行$ ruby page_generator_with_layout.rb,因为服务器直接查看视图(.html.erb文件),但不是.html; (纠正我,如果我错了,因为我现在正在做这个练习,并且早些时候犯了同样的错误)