我遵循M. Hartl的Ruby On Rails教程的每一步,但仍停留在第2章(「Hello world」 )。我在application_controller.rb
改變了代碼:Hartl Rails教程第2章「hello world」未在http:// localhost:3000中顯示
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
def hello
render html: "hello, world!"
end
end
而且routes.rb
到:
Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
root 'application#hello'
end
但是還是我的http://localhost:3000
頁是空白。我使用的Rails版本5.0.0.1和Ruby 2.2.4p230的Postgres。
__
EDIT1
而且我創建public/index.html
與<h1>HELLO WORLD</h1>
,消息
__
EDIT2
原來你需要的是後重新啓動服務器在routes.rb
我剛剛紡我的本地機器上的'toyapp',並提出您的具體變化和它的工作。 development.log是什麼意思?檢查 /log/development.log當你嘗試渲染http:// localhost:3000 –
CDub