I’m new in Ruby On Rails. I installed in 2 days ago on windows and now I want to create a simple “Hello Rails” with it. I use This Tutorial. I did all the steps described in this it does’nt work. the steps are:
- write this command in PowerShell: rails generate controller home index
- Open app/views/home/index.html.erb in text editor and edit it to contain a single line
of code:Hello, Rails!
-
delete the default page from application with this command
rm public/index.html -
Open the file config/routes.rb in editor, and edit root
:to => “welcome#index”
to
:to => “home#index”
- navigate to
in my browser but I see this error instead Hello Rails:
(I don’t have enough reputation to post image of error)
Routing Error
No route matches [GET] “/”
Can anybody tell me whats the problem?
Thanks
Make sure the only content in your
config/routes.rbfile is the following:(just delete everything else for now to make sure it’s clean)
Also, try killing the server and making sure that you don’t still see that error message (which could indicate that another server is still running somewhere). Along these lines, make sure you see the request in your console output when you fetch the page.
If you’re still getting the error, look for any clues in the console error messages.