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

Wed, December 5, 2012 - 2 min read

Ruby on Rails のプロジェクトにて、rake タスクに FactoryGirl 経由で Devise の user を作成したら、エラー出て死んだ。

■ エラーメッセージ

Could not find a valid mapping for #

そして、rake も rails s も rails c も何もできなくなった。

とりあえず、rvm 使っていたので、gemset を作り直すことで rake や rails s などは実行できるようになった。

しかし、User登録については、まだ解決できてない。ダレカタスケテ

【参考】

Reloading Factory Girl Factories in the Rails 3 Console | Transcending Frontiers はてなブックマーク - 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 <img src=“http://b.hatena.ne.jp/entry/image/http://stackoverflow.com/questions/6363471/could-not-find-a-valid-mapping-for-user-only-on-second-and-successive-t” alt=“はてなブックマーク - devise - “Could not find a valid mapping for #<User …>” only on second and successive tests - Stack Overflow” border=“0” />