IntelliJ Idea Ultimate red-underlines Ruby shorthand hash literal IntelliJ Idea Ultimate red-underlines Ruby shorthand hash literal ruby ruby

IntelliJ Idea Ultimate red-underlines Ruby shorthand hash literal


How I fixed this in Intellij 14.1:

  1. File -> Project Structure
  2. Delete the existing module which defaulted to Java (doesn't delete the actual files)
  3. Use green + button to create a new module with same name/location, but this time associated with Ruby on Rails instead of Java (with correct SDK)
  4. File -> Close Project
  5. Reopen project.

Previously I tried just changing the project SDK from the default of Java to Ruby, but this didn't fix the issue.


Under OSX IntelliJ 14 I was able to fix this by closing the project and reopening it.

In fairness, I did try setting the project's "language level", but it only shows Java SDKs, which shouldn't affect my main Ruby module.


This seems to be a bug in the Ruby plugin: http://devnet.jetbrains.com/thread/457333

Anyone who doesn't feel like changing his code base, the following steps resolved the issue for me:

  • Open File -> Project Structure
  • Open the Project Tab
  • Change the Project Language Level
  • Click OK

IntelliJ now asks if you would like to reload your project. After doing so the "new" Hash Syntax is considered correct...

Edit: It doesn't really matter what you select as language level as it is only relevant for Java code, but apparently this triggers something in the code parser...