1

I'm trying to remove some attribute from my table using rails migration, I create the migration file and write this code :

class RemoveCompanySendReportAttributes < ActiveRecord::Migration[5.1]
  def change
    remove_colmun :companies, :time_limit_for_sending_report, :integer
    remove_column :companies, :automatically_send_report, :boolean
  end
end

it doesn't work and this is the error in my terminal :

Please register a mime type using register_mime_type then use register_compressor or register_transformer. https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors (called from block in at /home/sa7noun/altagem-project/web/config/initializers/haml.rb:24) == 20180412151847 RemoveCompanySendReportAttributes: migrating ================ -- remove_colmun(:companies, :time_limit_for_sending_report, :integer) rake aborted! StandardError: An error has occurred, this and all later migrations canceled:

undefined method `remove_colmun' for

1
  • 2
    undefined method remove_colmun - you have a typo in first line of change method Commented Apr 12, 2018 at 16:07

1 Answer 1

2

Part 1

Please register a mime type using register_mime_type then use register_compressor or register_transformer.

It is a sprockets issue, the quick fix is

gem 'sprockets', '3.6.3'

but existing one will work on the production env.

Part 2

And migration error for remove_column you have written remove_colmun it is the wrong type that's why

undefined method `remove_colmun' for

it will be remove_column

And look while you remove a column you don't need to mention the field type like integer or boolean or etc... Just simply

remove_column :companies, :time_limit_for_sending_report

Once you make any update in your Gemfile, ensure you run bundle install or update

Sign up to request clarification or add additional context in comments.

3 Comments

If you're using remove_column in the migration's change method, adding the type will make the migration reversible if you need that.
I launched the command again without modify anything and this time it works ! and I do not know why!
I think you rename the remove_colmun to remove_column because the right is remove_column