Generating mongoid config in rails hangs

If setting up a new Rails project with Mongoid and trying to run rails g mongoid:config hangs, try

spring stop
spring start

and then running rails g mongoid:config should work again.