[Ruby][FactoryGirl] Could not find a valid mapping for #<User

Tadashi Shigeoka ·  Wed, December 5, 2012

In a Ruby on Rails project, when I tried to create a Devise user via FactoryGirl in a rake task, I got an error and it crashed.

■ Error Message

Could not find a valid mapping for #

And then rake, rails s, rails c - nothing worked anymore.

For now, since I was using rvm, I was able to run rake and rails s by recreating the gemset.

However, I still haven’t solved the User registration issue. Someone please help.

【Reference】

Reloading Factory Girl Factories in the Rails 3 Console | Transcending Frontiers

devise - “Could not find a valid mapping for #<User …>” only on second and successive tests - Stack Overflow

That’s all from the Gemba.