@kyanny's blog

My life. Opinions are my own.

irb/pry から MongoMapper を使うと NameError: uninitialized constant ActiveModel::Serializers::Xml が出るときの対処法

gem 'activemodel', '4.2.9'
require 'active_model'
require 'mongo_mapper'

MongoMapper.database = 'testing'

class Foo
  include MongoMapper::Document
end

Foo.destroy_all
Foo.create

p [Foo.count, 'good']

NameError: uninitialized constant ActiveModel::Serializers::Xml in MongoMapper · GitHub