作者Reinhard (2nd serve)
看板Ruby
标题请问 AWD with Rails 2/e 的 Hello Rails
时间Tue May 29 15:27:33 2007
昨天买了 Agile Web Development with Rails,
今天就照着书上第四章所写很期待的写了个 Hello Rails。
不过碰到一个奇怪的问题,
我打 localhost:3000 是ok的,可见 server 有跑起来。
但我 ruby generate controller Say 之後,
也在 app/controllers/say_controller.rb 中定义了 hello
app/views/say/ 底下也已照书中写好了 hello.rhtml,
localhost:3000/say/hello 却是 Not found
请问可能是哪里出错了呢?
我的作业系统是 Ubuntu 6.06
server 是用 webrick
(ruby server webrick 所跑起来)
先谢谢各位的解惑,我自己搞有点久了… @"@
---
以下是开 webrick 那个 terminal 所输出的错误讯息…
#<NameError: uninitialized constant Breakpoint>
["../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:123:in
`const_missing'",
"../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:131:in
`const_missing'",
"../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:133:in
`const_missing'", "../config/../vendor/rails/railties/lib/dispatcher.rb:75:in
`reset_after_dispatch'",
"../config/../vendor/rails/railties/lib/dispatcher.rb:46:in `dispatch'",
"../config/../vendor/rails/railties/lib/webrick_server.rb:115:in
`handle_dispatch'",
"../config/../vendor/rails/railties/lib/webrick_server.rb:81:in `service'",
"/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'",
"/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'",
"/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'",
"/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'",
"/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'",
"/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'",
"/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'",
"/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'",
"../config/../vendor/rails/railties/lib/webrick_server.rb:67:in `dispatch'",
"../config/../vendor/rails/railties/lib/commands/servers/webrick.rb:59",
"../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:147:in
`require'", "../config/../vendor/rails/railties/lib/commands/server.rb:30",
"server:3"]
[2007-05-29 15:27:08] ERROR `/say/hello' not found.
127.0.0.1 - - [29/May/2007:15:27:08 CST] "GET /say/hello HTTP/1.1" 404 279
- -> /say/hello
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.4.234
1F:推 deduce:把你的say_controller.rb po出来看看呢? 05/29 16:14
2F:推 godfat:我觉得有点像 routes 出问题 05/29 19:38