Rake Aborted! Undefined Method 'Migration_Error=' for Activerecord::Base:Class

undefined method `mysql_connection' for ActiveRecord::Base:Class

Thank's everyone
The error was resolve there is gem dependency issue
i have use gem mysql2 , activerecord-mysql2-adapter , mysql so there is conflicts error instead of it I have use only mysql2 gem change the adapter mysql to mysql2

Rake is aborting because undefined method `inet'

Use postgres_ext gem that supports enhanced datatypes of Postgres like inet.

An example postgres_ext: Adding Postgres data types to Rails.

postgres_ext adds migration and schema.rb support for the following PostgresSQL type:

  • INET
  • CIDR
  • MACADDR
  • UUID
  • Arrays

On Migration: undefined method `to_sym' for nil:NilClass

This is a problem that I have had with rails migrations. You misspelled or misordered a field with its name. Here is what you can do.

  1. If you have only done one migration since the problem.
  2. rake db:rollback.
  3. That will get you to the mistake and you can change the problem which I will talk about more later.
  4. If it is not the last migration keep going with rake db:rollback until you are there and the problem is fixed.

The problem is something like this. Notice the order on the first one and the spelling on the second one. These are two problems that have giving me the same situation you are in right now which is that to_sym bs.

For example;

 :books, :integer, :name #here I have `integer` before the name
:books, :name, :integr #here I have the order right but spelling is a problem.

Let me know if you have more questions.

If you cannot rake db:rollback then make a new migration, drop the table giving the problem, and regenerate. I've had to do that before. Just make sure you get your order right.



Related Topics



Leave a reply



Submit