我想RoR中創建一個非常簡單的Hello,world程序,但是當我去查看URL http://localhost:3000/say/hello
我收到錯誤消息No route matches: "say/hello"
沒有路由匹配「說/你好」時,路由存在
當我開始在軌服務器我得到警告此消息散佈:
=> Booting WEBrick
=> Rails 3.0.9 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-06-20 20:02:44] INFO WEBrick 1.3.1
[2011-06-20 20:02:44] INFO ruby 1.9.2 (2011-02-18) [i686-linux]
[2011-06-20 20:02:44] WARN TCPServer Error: Address already in use - bind(2)
Exiting
/home/eyedea/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
from /home/eyedea/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/utils.rb:73:in `new'
from /home/eyedea/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners'
from /home/eyedea/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/utils.rb:70:in `each'
from /home/eyedea/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners'
from /home/eyedea/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/server.rb:74:in `listen'
from /home/eyedea/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize'
from /home/eyedea/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize'
from /home/eyedea/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.3/lib/rack/handler/webrick.rb:10:in `new'
from /home/eyedea/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.3/lib/rack/handler/webrick.rb:10:in `run'
from /home/eyedea/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.3/lib/rack/server.rb:217:in `start'
from /home/eyedea/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/commands/server.rb:65:in `start'
from /home/eyedea/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/commands.rb:30:in `block in <top (required)>'
from /home/eyedea/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/commands.rb:27:in `tap'
from /home/eyedea/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
我開始:導軌產生控制器問好再見 列出路線得到「說/你好」
另外:我'm h這可能與此問題有關。當我去寫一些基本的HTML中,這顯然是列爲現有的文件之一,我得到這個:
我寫這篇文章:
~/work/demo$ /app/views/say/hello.html.erb
得到的回報此錯誤消息:
bash: /app/views/say/hello.html.erb: No such file or directory
這是怎麼回事?我直接從Agile Development with Rails獲得這些說明,它非常簡單。我不明白髮生了什麼事。
[路由不存在時匹配「say/hello」路由存在時可能的重複](http://stackoverflow.com/questions/6418549/no-route-matches-say-hello-when-route-exists) –