$ rake db:migrate
== ChangeFriendListToText: migrating - ======================================
-- change_column(:profiles, :friend_list, :text)
rake aborted!
An error has occurred, all later migrations canceled:
Can't find file: './shadow_development/profiles.frm' (errno: 13)
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:263:in `query'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:263:in `execute'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:413:in `columns'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:598:in `column_for'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:451:in `change_column'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:352:in `block in method_missing'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:328:in `block in say_with_time'
/Users/me/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mechmark.rb:280:in `measure'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:328:in `say_with_time'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:348:in `method_missing'
db/migrate//20130110234754_change_friend_list_to_text.rb:3:in `up'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:282:in `block in migrate'
/Users/me/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mechmark.rb:280:in `measure'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:282:in `migrate'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/ar-octopus-0.3.4/lib/octopus/migration.rb:52:in `migrate_with_octopus'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:365:in `migrate'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:491:in `block (2 levels) in migrate'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:567:in `call'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:567:in `ddl_transaction'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:490:in `block in migrate'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:477:in `each'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:477:in `migrate'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:401:in `up'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-2.3.14/lib/active_record/migration.rb:383:in `migrate'
/Users/me/.rvm/gems/ruby-1.9.3-p194/gems/rails-2.3.14/lib/tasks/databases.rake:112:in `block (2 levels) in <top (required)>'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/me/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/me/sources/shadow/lib/rake_exceptional.rb:7:in `standard_exception_handling'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `load'
/Users/me/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `<main>'
/Users/me/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/Users/me/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
$どのmysql
/usr/local/mysql-5.5.24-osx10.6-x86_64/bin/mysql
$ ls /usr/local/mysql-5.5.24-osx10.6-x86_64/data/shadow_development/profiles.frm
/usr/local/mysql-5.5.24-osx10.6-x86_64/data/shadow_development/profiles.frm
Ruby 1.9.3p194 (2012-04-20 リビジョン 35410) [x86_64-darwin11.3.0] と Rails 2.3.14 を Mac OS X 10.7.5 で使用する
更新:移行ファイルは次のとおりです。
class ChangeFriendListToText < ActiveRecord::Migration
def self.up
change_column :profiles, :friend_list, :text
end
def self.down
change_column :profiles, :friend_list, :string
end
end