lsegal/yard — Issue #498: yard server --reload crashes with "RuntimeError: can't add a new key into hash during iteration"
Author: vrinek
Created: 2012-03-07 09:28:35+00:00
State: open

After running `bundle exec yard server --reload` and visiting `localhost:8808` I was greeted with an error.

The whole trace:

[2012-03-07 11:20:41] ERROR RuntimeError: can't add a new key into hash during iteration
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/registry_store.rb:54:in `[]='
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/registry_store.rb:54:in `put'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/registry_store.rb:38:in `get'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/registry.rb:234:in `at'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/serializers/yardoc_serializer.rb:20:in `method_missing'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/serializers/yardoc_serializer.rb:86:in `dump'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/serializers/yardoc_serializer.rb:86:in `dump'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/serializers/yardoc_serializer.rb:65:in `serialize'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/registry_store.rb:143:in `save'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/registry.rb:157:in `save'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/cli/yardoc.rb:216:in `run'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/server/commands/library_command.rb:68:in `block (2 levels) in setup_yardopts'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/server/commands/library_command.rb:65:in `chdir'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/server/commands/library_command.rb:65:in `block in setup_yardopts'
:10:in `synchronize'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/server/commands/library_command.rb:64:in `setup_yardopts'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/server/commands/library_command.rb:59:in `setup_library'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/server/commands/library_command.rb:48:in `call'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/server/router.rb:135:in `route_docs'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/server/router.rb:110:in `route'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/server/router.rb:54:in `call'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/yard-0.7.5/lib/yard/server/rack_adapter.rb:51:in `call'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/rack-1.2.2/lib/rack/content_length.rb:13:in `call'
[project_dir]/vendor/bundle/ruby/1.9.1/gems/rack-1.2.2/lib/rack/handler/webrick.rb:52:in `service'
[home_dir]/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
[home_dir]/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
[home_dir]/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

When running the server with `bundle exec yard server` it works fine.

**Versions**

**rails 3.0.4** (the project)
**yard 0.7.5**