Read more

Rubymine FileType mismatch

Natalie Zeumann
November 15, 2018Software engineer at makandra GmbH

If your Rubymine does not recognize a file type correctly although you have entered the unmistakeable file extension like material_orders_controller.rb, this may help you:

Causing the Problem

Illustration book lover

Growing Rails Applications in Practice

Check out our e-book. Learn to structure large Ruby on Rails codebases with the tools you already know and love.

  • Introduce design conventions for controllers and user-facing models
  • Create a system for growth
  • Build applications to last
Read more Show archive.org snapshot

Sometimes you create a new file and forget to enter the ending like material_orders_controller
Rubymine handles such files per default as simple txt files.
You delete this file and create a new one with correct ending: material_orders_controller.rb. But still Rubymine treats this file as text file, no highlighting is available.

What happened?

Rubymine saves file name patterns to assign the correct file types. *.rb for example is one pattern to identify ruby files. But why does Rubymine not identify your file correctly although it matches this pattern?

Because Rubymine tries to remember types for "new" files which don't match any pattern. So it happens that it saves a pattern for material_orders_controller and assigns it to txt file type.

Solutions

a) Don't delete and recreate the file. Only change the exiting file's name and add the correct extension.
b) If already happend: Remove the pattern from txt file type patterns Rubymine:

File -> Settings -> Editor -> File Types -> Text
Posted by Natalie Zeumann to makandra dev (2018-11-15 15:33)