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 web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
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)