Ruby on rails Ruby模糊关系“trigrams”不存在
我试图在我的rails应用程序中模糊地使用RubyGem,但是我得到了这个错误Ruby on rails Ruby模糊关系“trigrams”不存在,ruby-on-rails,ruby,rubygems,Ruby On Rails,Ruby,Rubygems,我试图在我的rails应用程序中模糊地使用RubyGem,但是我得到了这个错误 relation "trigrams" does not exist 我遵循了所有的指示 这是我的密码 trigram.rb class Trigram < ActiveRecord::Base include Url::Model include Fuzzily::Model end 我错误地命名了迁移文件。当我将其更改为20150830110623\u add\u trigrams\u mode
relation "trigrams" does not exist
我遵循了所有的指示
这是我的密码
trigram.rb
class Trigram < ActiveRecord::Base
include Url::Model
include Fuzzily::Model
end
我错误地命名了迁移文件。当我将其更改为20150830110623\u add\u trigrams\u model.rb时,我可以工作。我做了一个rake db:migrate。它到底应该做什么?我应该寻找什么?我将迁移重命名为您所说的,现在得到这个错误名称error:uninitialized constant AddTrigramModel
class Url < ActiveRecord::Base
fuzzily_searchable :short_url
end
class AddTrigramsModel < ActiveRecord::Migration
extend Url::Migration
extend Fuzzily::Migration
trigrams_owner_id_column_type = :uuid
end
Url.find_by_fuzzy_short_url('sojdgl')
Url Load (1.4ms) SELECT "urls".* FROM "urls" ORDER BY "urls"."id" ASC LIMIT 100
PG::UndefinedTable: ERROR: relation "trigrams" does not exist
LINE 5: WHERE a.attrelid = '"trigrams"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"trigrams"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "trigrams" does not exist
LINE 5: WHERE a.attrelid = '"trigrams"'::regclass