`can't modify frozen Hash` error in development when running a rake task
Introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17369.
That's because we only try to modify the hash in the dev environment, thus tests pass, and production won't be affected neither.
This can be reproduced in latest master
with bin/rake routes
.
rake aborted!
can't modify frozen Hash
/Users/clement/gdk-ee/gitlab/config/initializers/routing_draw.rb:5:in `instance_eval'
/Users/clement/gdk-ee/gitlab/lib/api/services.rb:3:in `<module:API>'
/Users/clement/gdk-ee/gitlab/lib/api/services.rb:2:in `<top (required)>'
/Users/clement/.rvm/gems/ruby-2.3.2/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:457:in `load'
/Users/clement/.rvm/gems/ruby-2.3.2/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:457:in `block in load_file'
/Users/clement/.rvm/gems/ruby-2.3.2/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:647:in `new_constants_in'
/Users/clement/.rvm/gems/ruby-2.3.2/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:456:in `load_file'
/Users/clement/.rvm/gems/ruby-2.3.2/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:354:in `require_or_load'
/Users/clement/.rvm/gems/ruby-2.3.2/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:494:in `load_missing_constant'
/Users/clement/.rvm/gems/ruby-2.3.2/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:184:in `const_missing'
/Users/clement/gdk-ee/gitlab/lib/api/api.rb:161:in `<class:API>'
/Users/clement/gdk-ee/gitlab/lib/api/api.rb:2:in `<module:API>'
/Users/clement/gdk-ee/gitlab/lib/api/api.rb:1:in `<top (required)>'
Edited by Rémy Coutable