本文介绍了关系“翻译";迁移到Rails 3.2.1后不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从Rails 3.1.3迁移到3.2.1,并在加载主页时遇到以下错误:
I migrated from Rails 3.1.3 to 3.2.1 and got the following error when loading the home page:
PGError: ERROR: relation "translations" does not exist
LINE 4: WHERE a.attrelid = '"translations"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"translations"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
当globalize3 gem试图建立page_meta_tags和page_meta_tag_translations表之间的关系时,会发生这种情况.在Rails 3.1.3上一切正常.可能是由于新的Active Record和globalize3不兼容造成的吗?任何人都有同一件事吗?
This happens when globalize3 gem tries to build the relation between page_meta_tags and page_meta_tag_translations tables. Everything worked fine on Rails 3.1.3. Can it be due to new Active Record and globalize3 incompatibility? Anyone has the same thing?
class PageMetaTag < ActiveRecord::Base
translates :title, :description, :keywords
accepts_nested_attributes_for :translations
end
推荐答案
尝试使用globalize3 beta:
try using globalize3 beta:
gem 'globalize3', '0.2.0.beta8'
这篇关于关系“翻译";迁移到Rails 3.2.1后不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!