Ich folge dem Rat der Antwort here und haben bestätigt, dass: tailcall_optimization => true und: trace_instruction => falsch, aber ich bin immer noch:Stapelebene zu tief, obwohl der rekursive Aufruf am Ende der Funktion ist?
SystemStackError: stack level too deep
...
... 8696 levels...
Was mache ich falsch?
def persist_shipments_then_next(prev_data)
persist_shipments(prev_data)
next_token = prev_data['NextToken']
puts next_token
unless next_token.nil?
next_data = @client.list_inbound_shipments_by_next_token(
next_token
).parse
persist_shipments_then_next(next_data)
end
end
Update: Ich entfernte die von application.rb folgenden und es funktioniert WTF ?:
RubyVM::InstructionSequence.compile_option = {
tailcall_optimization: true,
trace_instruction: false
}
http://www.rubyappcare.com/blog/2016- 09-01-debugging-stack-level-too-deep-Fehler-auf-Schienen Hoffentlich wird dies helfen, den genauen Grund für den Fehler herauszufinden. –
Überprüfen Sie dies: http://nithinbekal.com/posts/ruby-tco/. Ich denke, ist 'tailcall_optimizer', was das Problem verursacht –