我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