From: Gary Wright Date: 2009-10-01T05:54:19+09:00 Subject: Re: SystemStackError: stack level too deep > how make it deeper? On Sep 30, 2009, at 3:47 PM, Joshua Muheim wrote: > But I'd like to run it and run it and run it without this > limitation. Is > there a workaround for this, so I can change the stack level maximum? I'm assuming a Unix/Linux environment... The stack limitation is enforced by the OS. You'll have to change the limits in your shell so that when the Ruby interpreter is started it is allowed to grow a larger stack. Try this first: $ ruby -e 'def foo(count); print "#{count} "; foo(count+1); end; foo(0)' to see how deep your stack can go. Bash, ksh, and zsh all have the ulimit command for setting process resources (such as the stack size): $ ulimit -a will show you the current limits and $ ulimit -s 16384 will change your stack size to 16384k (for example). Now run the ruby one liner I showed above and you should see that the program recurses deeper before failing. Gary Wright