Rails Server gets killed without a error message

Hello,

I working on a new project and made all the templates ready.

But as soon as I do rails s I see this output :

Started GET “/” for 82.74.205.109 at 2015-03-13 15:25:30 +0000

Killed

Anyone a idea how to find out what can be the reason behind this ?

Roelof

What do you see in the logs ?

In the development logs nothing wierd :

[1m[35mActiveRecord::SchemaMigration Load (6.7ms)[0m SELECT schema_migrations.* FROM schema_migrations

Started GET “/” for 82.74.205.109 at 2015-03-13 13:16:32 +0000
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT schema_migrations.* FROM schema_migrations[0m
Processing by Rails::WelcomeController#index as HTML
Rendered /home/action/.gem/ruby/2.1.1/gems/railties-4.1.0/lib/rails/templates/rails/welcome/index.html.erb (2.3ms)
Completed 200 OK in 28ms (Views: 9.5ms | ActiveRecord: 0.0ms)

Started GET “/products” for 82.74.205.109 at 2015-03-13 13:16:51 +0000
Processing by ProductsController#index as HTML
[1m[35mProduct Load (0.4ms)[0m SELECT products.* FROM products
Rendered products/index.html.erb within layouts/application (2.4ms)
Completed 200 OK in 1134ms (Views: 1130.8ms | ActiveRecord: 0.4ms)

Started GET “/assets/products.css?body=1” for 82.74.205.109 at 2015-03-13 13:16:52 +0000

Started GET “/assets/products.js?body=1” for 82.74.205.109 at 2015-03-13 13:16:52 +0000

Started GET “/assets/scaffolds.css?body=1” for 82.74.205.109 at 2015-03-13 13:16:52 +0000

Started GET “/assets/jquery.js?body=1” for 82.74.205.109 at 2015-03-13 13:16:52 +0000

Started GET “/assets/turbolinks.js?body=1” for 82.74.205.109 at 2015-03-13 13:16:52 +0000

Started GET “/assets/application.css?body=1” for 82.74.205.109 at 2015-03-13 13:16:53 +0000

Started GET “/assets/jquery_ujs.js?body=1” for 82.74.205.109 at 2015-03-13 13:16:53 +0000

Started GET “/assets/application.js?body=1” for 82.74.205.109 at 2015-03-13 13:16:53 +0000

Started GET “/” for 82.74.205.109 at 2015-03-13 15:25:12 +0000

Started GET “/” for 82.74.205.109 at 2015-03-13 15:25:30 +0000

Roelof

Hello,

I working on a new project and made all the templates ready.

But as soon as I do rails s I see this output :

Started GET "/" for 82.74.205.109 at 2015-03-13 15:25:30 +0000
Killed

You have not said whether this is a random event or whether it happens
every time.
Assuming it is repeatable can you copy/paste the full output from the
server window please. From the start of the server. Obviously
restart the server and then do it so as to keep it short.

Anything in /var/log/syslog (or wherever your equivalent system log
is) at the time it happens?

Colin

Wierd. I do not see it this time.

Maybe a hickup in a server,

But now I see another wierd error.

I have a page new who looks like this :

New product

<%= render ‘form’ %>

<%= link_to ‘Back’, products_path %>

Which leads to a file named _form.html who looks like this :

<%= form_for(@product) do |f| %>
<% if @product.errors.any? %>


<%= pluralize(@product.errors.count, “error”) %> prohibited this product from being saved:

Voer nieuw speelgoed in

    1. Algemene informatie

Nummer speelgoed: *
       </div>
   </div><!--end control-group-->
Naam speelgoed: *
Omschrijving: *

    2. Koop informatie

Bedrijf:*
Bedrag:*
Datum aankoop: *
Opslaan
  </form><!--end form-->

<% end %>

But as soon asI do products/new I see this error message :

/home/action/workspace/finance/app/views/products/_form.html.erb:85:

syntax error, unexpected keyword_ensure, expecting keyword_end
/home/action/workspace/finance/app/views/products/_form.html.erb:87: syntax error, unexpected end-of-input, expecting keyword_end

Roelof

How much RAM is available? Sometimes some processes get killed when they occupy too much of memory.

Do this. Run server. Open another tab and type top. Refresh page and check memory consumption.

Wierd. I do not see it this time.
Maybe a hickup in a server,

But now I see another wierd error.

I have a page new who looks like this :

<h1>New product</h1>
<%= render 'form' %>
<%= link_to 'Back', products_path %>

Which leads to a file named _form.html who looks like this :

I presume you mean _form.erb.

<%= form_for(@product) do |f| %>
  <% if @product.errors.any? %>

Where is the end for this if?

    <div id="error_explanation">
      <h2><%= pluralize(@product.errors.count, "error") %> prohibited this
product from being saved:</h2>
      <div class="row">
    <div class="span9">
     <div class="register">
      <div class="titleHeader clearfix">
       <h3>Voer nieuw speelgoed in </h3>
      </div><!--end titleHeader-->
      <form method="post" action="http://egythemes.com/shopfine/page"
class="form-horizontal">

Nested forms are not valid html, though that is not the cause of the
syntax error.

       <h4>&nbsp;&nbsp;&nbsp;&nbsp;1. Algemene informatie </h4>
       <div class="control-group ">
           <label class="control-label" for="inputFirstName">Nummer
speelgoed: <span class="text-error">*</span></label>
           <div class="controls">
             <input type="text" id="inputFirstName">

           </div>
       </div><!--end control-group-->
       <div class="control-group ">
           <label class="control-label" for="inputLastName">Naam speelgoed:
<span class="text-error">*</span></label>
           <div class="controls">
             <input type="text" id="inputLastName">
            </div>
       </div><!--end control-group-->
       <div class="control-group">
           <label class="control-label" for="inputEMAdd">Omschrijving:
<span class="text-error">*</span></label>
           <div class="controls">
             <input type="text" id="inputEMAdd" >
           </div>
       </div><!--end control-group-->

       <h4>&nbsp;&nbsp;&nbsp;&nbsp;2. Koop informatie </h4>
       <div class="control-group">
           <label class="control-label" for="inputCompany">Bedrijf:<span
class="text-error">*</span></label>
           <div class="controls">
             <input type="text" id="inputCompany">
           </div>
       </div><!--end control-group-->
       <div class="control-group">
           <label class="control-label" for="inputCompanyID">Bedrag:<span
class="text-error">*</span></label>
           <div class="controls">
             <input type="text" id="inputCompanyID">
           </div>
       </div><!--end control-group-->
       <div class="control-group">
           <label class="control-label" for="inputFirstAdd">Datum aankoop:
<span class="text-error">*</span></label>
           <div class="controls">
             <input type="text" id="inputFirstAdd">
           </div>
       </div><!--end control-group-->
       <div class="control-group">
           <div class="controls">
               <button type="submit" class="btn
btn-primary">Opslaan</button>
           </div>
       </div><!--end control-group-->

      </form><!--end form-->
     </div><!--end register-->
    </div><!--end span9-->

   </div><!--end row-->
<% end %>

But as soon as I do products/new I see this error message :

/home/action/workspace/finance/app/views/products/_form.html.erb:85: syntax
error, unexpected keyword_ensure, expecting keyword_end
/home/action/workspace/finance/app/views/products/_form.html.erb:87: syntax
error, unexpected end-of-input, expecting keyword_end

That means that it expected more code, which almost always means
missing end statements.

Colin

I had these random “killed” messages in the past and it was a memory issue.
I was using vagrant box, and in my case I just increased the ram available to the VM.