Error ActiveRecord::StatementInvalid

Hello developers, I am in trouble.

When I load my web page, it returns “we’re sorry, but somethig went wrong”
and then I have seen my log and it returns this error:

Started GET “/” for 141.21.12.238 at 2014-04-11 09:39:10 +0200

Processing by Refinery::PagesController#home as HTML

Parameters: {“locale”=>:de}

Completed 500 Internal Server Error in 2ms

ActiveRecord::StatementInvalid (Could not find table ‘refinery_roles’):

app/models/refinery/role.rb:14:in `[]’

Before, I did the command rake db:migrate.
I hope your answers soon.
Antonio

On 11 April 2014 08:51, Antonio A. [email protected]
wrote:

Parameters: {“locale”=>:de}

Completed 500 Internal Server Error in 2ms

ActiveRecord::StatementInvalid (Could not find table ‘refinery_roles’):

app/models/refinery/role.rb:14:in `[]’

You have not told us several vital facts.

  1. Do you think there should be a table refinery_roles?
  2. If the answer to 1 is Yes, then is there actually such a table in
    the database?
  3. If the answer to 1 is No, then you need to show us the code around
    role.rb line 14 in order that we may help you to understand why it is
    expecting such a table.

Colin

Yes I have the table in the database but I do not why it don´t found.
here my role.rb:

module Refinery

end
end

Thanks
Antonio

El viernes, 11 de abril de 2014 14:34:28 UTC+2, Colin L. escribió:

On 11 April 2014 14:07, Antonio A. [email protected]
wrote:

Yes I have the table in the database but I do not why it don´t found.
here my role.rb:

How do you know that the table refinery_roles is in the db? Post the
contents of db/schema.rb here.

Colin

my schema contents:

I didn´t check the database because I can see in the file schema, but
How
can I access to database??. The app doesn´t load and when I check the
log
file, it returns me this:

Started GET “/” for 141.21.37.37 at 2014-04-11 15:17:00 +0200
Processing by Refinery::PagesController#home as HTML
Parameters: {“locale”=>:de}
Completed 500 Internal Server Error in 2ms

ActiveRecord::StatementInvalid (Could not find table ‘refinery_roles’):
app/models/refinery/role.rb:14:in `[]’

Sorry about that.
I am new here.
thanks for all
Antonio

On 14 April 2014 08:38, Antonio A. [email protected]
wrote:

I didn´t check the database because I can see in the file schema, but How
can I access to database??. The app doesn´t load and when I check the log
file, it returns me this:

You are still top posting, I would prefer if you did not. If you
don’t know what I am talking about then google for
top posting

Are you using mysql or sqlite? If mysql then use the mysql command in
a terminal. I think there is a similar tool for sqlite. Google will
easily find you a tutorial on how to use it.

You still have not answered the other questions about the app. How is
it that the schema suggests that the db structure has not recently
been modified yet you said you had run db:migrate?

Colin

On 11 April 2014 14:54, Antonio A. [email protected]
wrote:

my schema contents:

encoding: UTF-8


ActiveRecord::Schema.define(:version => 20120717180765) do

First could you not top post please, it makes it difficult to follow
the thread. Thanks.
The above looks strange, suggesting that the db structure has not
changed since 2012, yet you told us you ran db:migrate. Is there
something you are not telling us? Is this an app that has worked and
for some reason it is no longer? Is it a new deploy? Is it just a
new bit of code that is not working but other stuff does? All
important info that helps to find the problem.


create_table “refinery_roles”, :force => true do |t|
t.string “title”
end

So that says the table should exist.

You did not answer my question as to how you know the table exists.
Have you checked for it in the database using mysql command line or
similar?

Colin

The app nerver works, It doesn´t new deploy, the app is a little web
page
but when I try to load, it doesn´t work.
Thanks for all.
Antonio

On 14 April 2014 10:09, Antonio A. [email protected]
wrote:

The app nerver works, It doesn´t new deploy, the app is a little web page
but when I try to load, it doesn´t work.

What don’t you understand about not top posting? Any more top posted
messages will be binned by me. Also you have not quoted the relevant
sections of the previous email.

How is it that the last time the db structure was updated is 2012?

Colin

even if the table is missing,the server use to start, try to delete the
model, check if the server start, if do it, begin to write the model,
and
restart the server after write a line, with that you can see what is
crashing the server

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs