【发布时间】:2009-12-08 09:08:18
【问题描述】:
(in /Users/sayedgamal/apps/test)
/Users/sayedgamal/apps/test/config/boot.rb:20:Warning: Gem::SourceIndex#search support for String patterns is deprecated
== CreatePeople: migrating ====================================================
-- create_table(:people)
rake aborted!
undefined method `string' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x238e97c>
(See full trace by running task with --trace)
我在发布时遇到了这个错误
rake db:迁移
命令 .. 在我的 rails 项目的根文件夹中 ..
migrate/001_create_people.rb contents :
class CreatePeople < ActiveRecord::Migration
def self.up
create_table :people do |t|
t.string :first_name
t.string :second_name
t.string :company
t.string :email
t.string :phone
end
end
def self.down
drop_table :people
end
end
注意:我也使用了整数和文本字段,但它不起作用.. 错误总是更改为未定义的数据类型 {string, integer, text ,...} 根据在迁移文件中键入的内容..! 注意:我在应用程序的根文件夹中使用 rake db:migrate。
【问题讨论】:
标签: ruby-on-rails ruby activerecord rake