Rubymine can't recognize ruby file

2.5k Views Asked by At

The file attendance_statistics_controller.rb can't be recognized as a ruby file. All other files can and when i change the name to anything else this one can aswell. It has nothing to do with the length of the filename.

enter image description here

The image on top shows how the ruby file is recognized as a textfile. Changing the name does the trick as shown on the one on the bottom.

enter image description here

Is it a bug in the application or is there something to do about it?

2

There are 2 best solutions below

3
On BEST ANSWER

The file name has been registered as being a .txt file

To fix this:

  1. Go to Rubymine | Preferences | Editor | filetypes.
  2. Find the Text file type in the list of recognized filetypes and click it.
  3. Then browse the registered patterns in the box just below and find the file name.
  4. Click it and remove it with the minus(-) button.
  5. Apply changes.
2
On

Judging from the file type icon in your screenshot, I guess you have accidentally enabled the Mark as Plain Text feature upon the file. Marking the file as plain text is accessible from the file's context menu and normally it can be used to prevent Rubymine from navigating and completing the code inside the file.

Right click the file and choose the "Mark as Ruby" item to make Rubymine recognize it as ruby code again.