Intellij detecting Rails projects as Web

While trying to setup a new Rails 5.2 app in Intellij it would continually be detected as a web project and give no way of adding the Ruby on Rails module.

The solution is to delete the node_modules folder before creating the new project.