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