Alexandre Calaça
Alexandre Calaça's Blog

Alexandre Calaça's Blog

Rails: NameError (uninitialized constant UserSerializer) error message

How to solve fast_jsonapi serializer error?

Alexandre Calaça's photo
Alexandre Calaça
·Jul 27, 2022·

2 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Table of contents

  • Introduction
  • Issue
  • Tests
  • Solution
  • Conclusion


The fast_jsonapi is a a lightning fast JSON:API serializer for Ruby Objects. Its github page can be accessed here.

The project is no longer maintained, but you might end up using it in some applications.


This is the usual error message:

NameError (uninitialized constant UserSerializer)



None of the following tests worked:

  • Leave terminal and open it again;
  • Open a new tab;
  • Open the terminal on VS Code;
  • Open the terminal on Linux console;
  • Reload! Rails console;


For me, it worked to stop spring, which is a Rails application preloader.

  1. Exit Rails console
  2. Stop the spring Rails application preloader
    spring stop
    By the way, you can see all the available spring commands by using help
    spring help
  3. Enter Rails console again
    rails c
    rails console
  4. Run the test command Here, I tried: User.first ).serializable_hash

image.png or just type


It'll return the class itself


  1. spring is still working
    In case you're a spring freak (Just kidding lol), spring is fine.

Leave the terminal


and there you go, spring is fine

spring status



That's all. Hope you guys liked it. Let me know if you need any help.

Share this