I also appreciate companies like Heroku for creating guides to help you quickly deploy your Rails 5 app online. It helps keep us developers focused on the task at hand, building great apps.
Why Rails for API Development?
Many people will argue that Rails is too big of a framework for a simple API. Still, oftentimes, a simple API ends up requiring different dev environments, simplified routing, CRUD generation, authentication, etc. so you're back to square one. The bottom line here is pretty simple, if you know Rails, then rest assured that many hardworking people took it upon themselves to keep your workflow running smoothly.
As for me, there are times when I use rails, and times when I prefer NodeJS. The deciding factor for me is, ultimately, maintenance. If I can't maintain this app, who will and what is their skill set?
Rails 5 requires Ruby 2.2.2 (or above), but only versions greater than 2.5.x are currently supported.
I also suggest installing JSON Formatter for Google Chrome. It will help with JSON readability.
Step 1 - Updating Ruby & Rails
The easiest way to manage different versions of Ruby is to use a version manager such as rbenv or RVM.
Install Ruby using rbenv
rbenv install 2.6.0
Add this to ~/.bash_profile.
eval "$(rbenv init -)"
Switch to Ruby 2.x.x
rbenv global 2.6.0
Update gem before you install rails
gem update --system
Using this precise version of Ruby, install this precise version of Rails and skip the documentation.
Even though you've told rails to configure your app for API development, you'll need to set a few gems to get things working correctly.
ACTIVE MODEL SERIALIZERS
Serialization gems are not included in the default Gemfile, so you must first add the Active Model Serializers manually.
If you're not familiar with AMS, it's the tool used to serialize Active Model objects. It's the secret sauce to Rails API development. Through AMS, the Rails community is mostly trying to standardize JSON API responses.
Add this to Gemfile
Then add this initializer by creating the file config/initializers/active_model_serializers.rb