8

I'm trying to create a simple application with Ruby on Rails. I've created this scaffold:

rails generate scaffold Pic title:string content:blob description:text

and when I try to migrate db with rake db:migrate I'm getting this error:

rake aborted!
An error has occurred, this and all later migrations canceled:

undefined method `blob' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0xb74f8ec4>

When I write say text instead of blob it works normally. So what's the problem with blob ?

anothermh
  • 9,815
  • 3
  • 33
  • 52
shift66
  • 11,760
  • 13
  • 50
  • 83

2 Answers2

14

The keyword is binary, not blob.

rails generate scaffold Pic title:string content:binary description:text
Dave Isaacs
  • 4,499
  • 6
  • 31
  • 44
2

There is no keyword blob in rails, you need binary.

rails generate scaffold Pic title:string content:binary description:text
Mikhail Nikalyukin
  • 11,867
  • 1
  • 46
  • 70