請問 AWD with Rails 2/e 的 Hello Rails

看板Ruby作者 (2nd serve)時間17年前 (2007/05/29 15:27), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串1/6 (看更多)
昨天買了 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

05/29 16:14, , 1F
把你的say_controller.rb po出來看看呢?
05/29 16:14, 1F

05/29 19:38, , 2F
我覺得有點像 routes 出問題
05/29 19:38, 2F
文章代碼(AID): #16MzNc5I (Ruby)
文章代碼(AID): #16MzNc5I (Ruby)