T
T
timoo2014-08-14 11:24:30
Ruby on Rails
timoo, 2014-08-14 11:24:30

[Ruby on Rails] Why doesn't my application work on localhost?

Hello.
Added StaticPages controller and view home.html.erb, about.html.erb, contacts.html.erb and help.html.erb to it.
When trying to open a page like localhost:3000/static_pages/home on the local server , it returns the error "We're sorry, but something went wrong.". I didn’t find anything in the logs except 500 Internal Server Error, but as far as I know this is a very common error, here is the log:

Started GET "/static_pages/home" for 127.0.0.1 at 2014-08-14 14:07:16 +0600
Processing by StaticPagesController#home as HTML
  Rendered static_pages/home.html.erb within layouts/application (0.5ms)
Completed 500 Internal Server Error in 16ms

An error occurred while traversing railstutorial.org chapter 4-5.
I use node.js as JavaScript runtime.
The whole general layout is written in layouts / application, which in turn is divided into partials (_header.html.erb, _footer.html.erb, _shim.html.erb). As a result, home.html.erb looks like this:
<div class="center hero-unit">
  <h1>Welcome to the Sample App</h1>

  <h2>
    This is the home page for the
    <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
    sample application.
  </h2>

  <%= link_to "Sign up now!", '#', class: "btn btn-large btn-primary" %>
</div>

<%= link_to image_tag("rails.png", alt: "Rails"), 'http://rubyonrails.org/' %>

I would appreciate any help, thanks.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Krasnodemsky, 2014-08-14
@tomcat1911

write routes in /config/routes.rb
which action in the controller corresponds to your route?
guides.rubyonrails.org/routing.html#connecting-url...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question