Я обновился с rails 3.0.0 до 3.0.11 (пока не хочу переходить на 3.1 по разным причинам)
Я изменил следующее в своем Gemfile:
-gem 'rails', '3.0.0'
-gem 'mysql2', "0.2.6"
+gem 'rails', '3.0.11'
+gem 'mysql2', "~>0.2.7"
Запустил консоль и попробовал:
PopularMedia.where(:media_type => 1).all
и получил это:
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'matcha_development.popular_media' doesn't exist: SELECT `popular_media`.* FROM `popular_media` WHERE `popular_media`.`id` = 1
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in `query'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in `block in execute'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/connection_adapters/abstract_adapter.rb:202:in `block in log'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.11/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/connection_adapters/abstract_adapter.rb:200:in `log'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in `execute'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:586:in `select'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/connection_adapters/abstract/query_cache.rb:56:in `select_all'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/base.rb:473:in `find_by_sql'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/relation.rb:64:in `to_a'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.11/lib/active_record/relation/finder_methods.rb:143:in `all'
from (irb):2
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.11/lib/rails/commands/console.rb:44:in `start'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.11/lib/rails/commands/console.rb:8:in `start'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.11/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Раньше работал нормально, так в чем может быть проблема?