How do I fix RubyGems push failure that results in Status 500 Stack level too deep error?

 When you try to run "gem push 'gem_name'" you might get the following error :  

{ "errors" : [ { "status" : 500, "message" : "(SystemStackError) stack level too deep" } ] }

   The solution/fix for this problem is as follows:

  • Delete the gem folder(s) inside your local RubyGem repository/repositories
  • Shutdown Artifactory.
  • Open artifactory.bat or file (depending on your OS) in your text-editor of choice (plain-text) and add  "-Djruby.compile.invokedynamic=false" to the end of the JAVA_OPTIONS environment variable declaration.
  • Save the file and restart Artifactory. 
  • You should see rubygems-update-version inside the gems folder(s).