Silly question: Is JRuby required for Ruby support in Intellij Ultimate's Ruby plugin?

I've got a few Ruby projects that I'd like to start editing in Intellij but running into some issues.

Question 1: Is JRuby required for any MRI Ruby project? I'd just like to say that this project is a Ruby project – not a JRuby project.

Question 2: How do I get 1.9 or 2.0 syntax highlighting working? In the project settings, the language level dropdown only has Java-centric versions. (I even tried adding a JRuby facet for the project and even that dropdown had Java-centric versions)

It's very confusing that I'd have to use JRuby when I just want to edit plain ol' Ruby.

Thanks in advance



the short answer: JRuby is not required.  Though I suspect you have asked about something else ;)

The long version: the problem is that Idea creates Java module when you open directory with a code but you need a Ruby module.
To fix that you need:

  1. open the project
  2. open project stracture (File|Project Structure)
  3. select modules
  4. delete the only module you have
  5. add new Ruby module
  6. as name you can use anything you want (e.g. directory name), as path the project root
  7. make sure that the correct ruby sdk is set for module sdk ("Gems" tab)
  8. (optional) if this is a rails app - add rails facet

Hope this helps, Oleg.


I've now tried this. Still, the project language level dropdown shows only Java-centric versions and the Ruby 1.9 hash-style syntax is red-underlined. Bug?


You can see this in this screenshot:


There is no such thing as ruby language level for a project in Idea.  It is configured for every module with ruby sdk.
Could you please show settings of the module you have ("Gems" tab is the most interesting thing in this case)

Regards, Oleg.


Hmm... it looks like I had to restart Intellij after creating the module for the syntax highlighting to work properly. Thanks for your help.

Why does a project that has nothing to do with Java have a language level selector specific to Java? Seems odd.


davemyron wrote:
Why does a project that has nothing to do with Java have a language level selector specific to Java? Seems odd.

I think this is bacause the main language for developing in Idea is Java, and so you may see some Java-centric solution here and there.

Regards, Oleg.


Please sign in to leave a comment.