title: How to change Ruby-on-Rails Virtual Machine 'stack size' on Windows?
body: <p>I got into the problem of running out of stack memory using <code>Nokogiri's gem</code> and parsing complex pages (<code>SystemStackError: stack level too deep</code>).</p>
  
  <p>I found a couple of threads here that said I need to change the stack size of Rubys VM, but since I am on a Windows 10 laptop, I seem to can't get it to work.</p>
  
  <p>When I open the ruby console and request the variable value I get: </p>
  
  <pre><code>irb&gt; ENV['RUBY_THREAD_VM_STACK_SIZE'] 
  =&gt; nil
  </code></pre>
  
  <p>when typing this, I do get a value for the stack size (name is slightly different)</p>
  
  <pre><code>irb&gt; RubyVM::DEFAULT_PARAMS
  =&gt; {:thread_vm_stack_size=&gt;1048576, :thread_machine_stack_size=&gt;1048576, :fiber_vm_stack_size=&gt;131072, :fiber_machine_stack_size=&gt;524288}    
  </code></pre>
  
  <p>I tryed out to installed the <code>dotenv gem</code> and set the variables in the <code>.env</code>file:</p>
  
  <pre><code>RUBY_THREAD_VM_STACK_SIZE = 50000000
  THREAD_VM_STACK_SIZE = 50000000
  </code></pre>
  
  <p>I can now see them in my <code>irb&gt;</code> as ENV variables, but the <code>RubyVM::DEFAULT_PARAMS</code> haven't changed.</p>
  
  <p>Any ideas how I can change the VM stack size for my application? Thanks a lot!!</p>