Cannot add blank pages with simple text to rails server

17 views
Skip to first unread message

Teguh Perdana Putra

unread,
Nov 21, 2017, 12:16:16 PM11/21/17
to Ruby on Rails: Talk
Dear ruby on rails group,

Good day!

I am now learning ruby on rails as a newbie to be able to make a simple website from scratch.

I am enrolled for onemonth course on Rails on Ruby for Web Development. One of their exercise is to change the default Rails page that can be seen from "localhost:3000" into a blank page with two sentences (basic strings).

I am running this with Git Bash on Windows. When inputting command "rails generate controller pages home" and open "localhost:3000/pages/home" in my browser, this is what I got instead of a blank page with two sentences.

And this is what I got in the Git Bash;

_______________________________________________________________________________________

Started GET "/pages/home" for 127.0.0.1 at 2017-11-21 13:42:40 +0800
Processing by PagesController#home as HTML
Rendering pages/home.html.erb within layouts/application
Rendered pages/home.html.erb within layouts/application (2.0ms)
Completed 500 Internal Server Error in 6707ms

ActionView::Template::Error (TypeError: Object doesn't support this property or
method):
4: <title>Omrails</title>
5: <%= csrf_meta_tags %>
6:
7: <%= stylesheet_link_tag 'application', media: 'all', 'data-turboli
nks-track': 'reload' %>
8: <%= javascript_include_tag 'application', 'data-turbolinks-track': 'r
eload' %>
9: </head>
10:

app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html
_erb__466066971_29636976'
Started GET "/pages/home" for 127.0.0.1 at 2017-11-21 13:45:08 +0800
Processing by PagesController#home as HTML
Rendering pages/home.html.erb within layouts/application
Rendered pages/home.html.erb within layouts/application (1.0ms)
Completed 500 Internal Server Error in 1696ms

-------------------------------------------------------------------------


Please kindly help me to understand, as I am a complete newbie who wants to have a very basic back-end programming. Without understanding this I am afraid my learning has come to a pause.


Thanks very much for your kindness, and I hope you all have a great day!


Cordially,

Teguh Perdana Putra

Olexandr Averyanov

unread,
Nov 22, 2017, 4:10:51 AM11/22/17
to Ruby on Rails: Talk
Hi there
I would recommend you to change your operation system to Ubuntu or some other Linux distributive, otherwise you will get strange errors very often.

About current problem - try to change parameter 'application' to 'default' in your app/views/layouts/application.html.erb line 7 and 8
Reply all
Reply to author
Forward
0 new messages