-1

Hello developers I am in trouble

When I try to do a rake db:migrate it returns a warning but it doesn't seems to do the migration. This is the error:

sanchez@danik21:/var/www/nubedianWebSite$ rake db:migrate
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /var/www/nubedianWebSite/Rakefile:7)
sanchez@danik21:/var/www/nubedianWebSite$

And then I have this error:

Started GET "/" for 141.21.12.238 at 2014-04-10 10:27:49 +0200
Processing by Refinery::PagesController#home as HTML
  Parameters: {"locale"=>:de}
Completed 500 Internal Server Error in 7ms

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

I am using rails 3.2.6 with refineryCMS.

I hope your answers soon. Antonio

  • Since you're using Rails 3.2, support for these old plugins is still included. This is simply a warning and should not abort the migration. There must be another problem. – KappaNossi Apr 10 '14 at 07:46
  • This most be the best error message I have seen so far. What part didn't you uderstand? – Severin Apr 10 '14 at 07:52
  • Please share the migration which doesn't work. –  Apr 10 '14 at 07:55
  • I don't understand why it doesn't do the migration because it don't return the table is created – user3510761 Apr 10 '14 at 07:56
  • possible duplicate of [Error activerecord ruby on rails](http://stackoverflow.com/questions/22962336/error-activerecord-ruby-on-rails) – Pavan Apr 10 '14 at 11:36

1 Answers1

2

As already stated what you are seeing is not an error, it's a warning. When you upgrade to Rails 4.0 you will need to make a change for vendor plugins, but given you are on 3.2.6 it's ok to ignore it for now.

The fact that rake db:migrate gives no other output implies there was nothing for it to do. This probably means the migration you think you are loading has already been applied to the database. You say the table is created; this is another indication that the migration was already applied.

The filename for the migration will start with a 14 digit number. In your database will be a table called schema_migrations. There is a single column in this table: version. If there is an entry in this table for that 14 digit number then the migration has already been applied so running rake db:migrate again will do nothing.

Migrations are supposed to be applied only once to each environment unless you roll it back.

  • I wrote the command rake db:migrate, after that, I saw the log and I have the next error.(up of the page you can see). – user3510761 Apr 10 '14 at 08:33
  • I don't believe the two things are connected. Did you check `schema_migrations` as I suggested? If the migration in question is not present then you need to show the migration code so we can help. Otherwise I think you should write a new question for this new error. You also need to show the code (`app/models/refinery/role.rb`) for us to be able help you. –  Apr 10 '14 at 08:43
  • I don not found the file schema_migrations, I created a new question – user3510761 Apr 10 '14 at 08:57
  • It's not a file, it's a table in the database. –  Apr 10 '14 at 09:02
  • I did not found this table – user3510761 Apr 10 '14 at 09:10
  • What tables do you have in your database? –  Apr 10 '14 at 09:34