我instance_methods执行bundle exec rake db:migrate
错误,同时运行捆绑高管耙分贝:迁移
/usr/lib/ruby/gems/1.8/gems/ancestry-2.1.0/lib/ancestry/instance_methods.rb:77: syntax error, unexpected ':', expecting ')'
self.class.where(id: (ancestor_ids + ancestor_ids_...
^
/usr/lib/ruby/gems/1.8/gems/ancestry-2.1.0/lib/ancestry/instance_methods.rb:77: syntax error, unexpected ')', expecting kEND
..._ids + ancestor_ids_was).uniq).each do |ancestor|
实际的代码后,得到了以下错误是
触摸每个这张唱片的祖先
def touch_ancestors_callback
# Skip this if callbacks are disabled
unless ancestry_callbacks_disabled?
# Only touch if the option is enabled
if self.ancestry_base_class.touch_ancestors
# Touch each of the old *and* new ancestors
self.class.where(id: (ancestor_ids + ancestor_ids_was).uniq).each do |ancestor|
ancestor.without_ancestry_callbacks do
ancestor.touch
end
end
end
end
end
我的与 https://github.com/stefankroes/ancestry/blob/master/lib/ancestry/instance_methods.rb#L97 比较的代码我不明白为什么我得到该错误。请帮助我。
预先感谢您。
你使用宝石不兼容版本的红宝石。至少使用ruby 2.0。 – 2014-11-01 22:11:27