Search code examples
mysqlruby-on-railsrubydatabasemigrate

Can't convert Bignum to string


I'm on a windows machine and I'm trying to make a scaffold with ruby's native powers, but I can't make this scaffold work, this is the command I'm using:

rails generate scaffold Page location_id:int title:varchar text:text type:int

I'm using mysql as the database engine and when I try to run "rake db:migrate" I'm getting the error: "Can't convert Bignum to string".

Can you guys please help me out.


Solution

  • I believe you need to use the correct Rails "types" in your scaffold such as integer and string:

    rails generate scaffold Page location_id:integer title:string text:text type:integer