Rails迁移执行失败:undefined method `remove_colmun'及MIME类型错误
Fixing Your Rails Migration Failure
Hey there! Let's break down what's tripping up your migration. The first (and most critical) issue here is a simple typo in your code:
remove_colmun :companies, :time_limit_for_sending_report, :integer
You've misspelled remove_column—it's missing an n at the end of "colmun". This typo makes Rails unable to recognize the method you're trying to use, which is why you're getting that confusing, truncated error message in your terminal.
Here's the corrected version of your migration file:
class RemoveCompanySendReportAttributes < ActiveRecord::Migration[5.1] def change remove_column :companies, :time_limit_for_sending_report, :integer remove_column :companies, :automatically_send_report, :boolean end end
Once you fix that typo, run the migration command again:
rails db:migrate
This should resolve the error and successfully remove those two columns from your companies table.
内容的提问来源于stack exchange,提问作者user9569059
相关产品推荐
相关产品推荐

