2012-02-24 14 views
8

मैं रेल में रूबी के साथ एक साधारण आवेदन बनाने की कोशिश कर रहा हूं। मैं इस पाड़ बना लिया है:रेल में ब्लॉब डेटाटाइप के मामले में डेटाबेस माइग्रेशन विफल क्यों होता है?

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

और जब मैं rake db:migrate मैं इस त्रुटि मिल रही है साथ db विस्थापित करने के लिए प्रयास करें:

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

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

जब मैं कहता हूँ textblob के बजाय यह सामान्य रूप से काम करता है लिखते हैं। तो blob के साथ समस्या क्या है?

उत्तर

13

कीवर्ड बाइनरी है, ब्लॉब नहीं है।

rails generate scaffold Pic title:string content:binary description:text 
2

रेल में कोई कीवर्ड ब्लॉब नहीं है, आपको बाइनरी की आवश्यकता है।

rails generate scaffold Pic title:string content:binary description:text 
संबंधित मुद्दे