I found this but honestly not sure how to install it or whether it applies. Thanks!
3 Answers
Ruby plug-in that you have linked is designed for IntelliJ IDEA Ultimate only, it will not work with PhpStorm. See this answer for more details.
However, it's possible to get the basic syntax highlighting for Ruby files in PhpStorm using the TextMate bundles support plug-in. It's already included with PhpStorm 6.0.1 and you don't need to install it, just make sure it's enabled in Settings
| Plugins
.
Git clone Ruby.tmbundle into some directory.
Add this directory in
Settings
|TextMate Bundles
:
For some reason PhpStorm TextMate Bundles support will not recognize *.rb
files as supported by this bundle. To fix this problem open Ruby.tmbundle\Syntaxes\Ruby.plist
file in some text editor, find <key>fileTypes</key>
section, add <string>rb</string>
under <array>
(the above should be fixed in the latest Ruby bundle version, so the editing the bundle is no longer needed, but if you are adding some other language bundle, it's something you may need to adjust)
Restart PhpStorm, verify that *.rb
is now associated correctly:
Now you get Ruby syntax highlighting in PhpStorm:
If you need full support for both Ruby and PHP (plus much more) in a single IDE, consider using IntelliJ IDEA Ultimate.

- 1
- 1

- 389,263
- 172
- 990
- 904
-
8Wish I'd known about IDEA Ultimate's capabilities before buying PHPStorm and RubyMine separately! – JackMahoney Jun 06 '13 at 02:13
-
1@JackMahoney buying separate products has its benefits, you get new features faster than in IDEA plug-ins and interface is less flooded with unrelated options, see also [this answer](http://stackoverflow.com/a/13829907/104891). – CrazyCoder Jun 06 '13 at 07:19
-
1Not to mention, the size/memory footprint of having the ultimate one – Ascherer Jun 10 '13 at 16:22
-
@JackMahoney I've bought both too, but I think separate products are much better. I can't imagine that you'd be working on a Ruby and PHP project at the same time. – Matt Humphrey Jun 20 '13 at 10:44
-
7This doesn't work in windows as a large number of the filenames are invalid in windows systems – Populus Jan 30 '14 at 16:39
-
@Populus thanks for the pointer, I've updated the answer with your link. – CrazyCoder Apr 24 '14 at 13:08
-
@Populus using the official repo still gives me filename problems on Windows. How did you guys solve this? – hgcrpd May 11 '14 at 04:23
-
@hgcrpd I used Intellij Idea Ultimate. – Populus May 11 '14 at 04:57
-
So in other words this doesn't work in windows because the textmate bundles have invalid windows filenames? – hgcrpd May 11 '14 at 07:34
-
This approach works with RubyMine too (and probably the other JetBrains IDEs). I added the Python bundle to RubyMine. – Mike T Oct 02 '14 at 00:04
-
ok @CrazyCoder any idea how to view python scripts in php storm? – abbood Nov 21 '14 at 11:23
-
1Does anyone else get a white background behind the text? I am using PHPStorm for Mac. My background is grey but the ruby file uses white until it is the selected line. – DutGRIFF Apr 18 '15 at 15:17
-
Thank you! Working almost perfectly on Windows 7 on PhpStorm - had to change my current custom dark theme's gray to #2C2C2C to get consistent bgcolor to match RailsCast theme. @DutGRIFF You have to change TextMate Color Scheme in Settings - Editor - Code Style - TextMate Bundles. – Scott Yang May 31 '15 at 08:58
-
I also added `
Vagrantfile ` into `Syntaxes\Ruby.plist` to get syntax highlighting for Vagrantfiles. – Sam Jun 17 '15 at 07:35 -
1I'm using the Darkula theme. For me, all of the whitespace was bright white and the highlighting was just awful. – Jimbo Jul 06 '15 at 20:04
-
4@jimbo you need to set the colour scheme under the textmate bundle plugin options. Preferences/Settings > Editor > TextMate Bundles, then you will see there is a listing of colour schemes with ide schemes on the left and textmate on the right, you can match up darcula to use darcula there. – Liam Potter Sep 14 '15 at 09:33
-
1@Sam i've added `# -*- mode: ruby -*- (\n<-replace this with a new line) # vi: set ft=ruby :` to the top of my vagrantfile which works too. – Jörn Apr 17 '16 at 22:21
-
1Works in Webstorm too! – Jörn Apr 17 '16 at 22:23
-
@CrazyCoder Ruby.tmbundler fixed the `rb` extension issue, editing the `Syntaxes/Ruby.plist` is not required anymore. Could you update your answer with this information? – Gabor Garami Oct 10 '16 at 13:24
-
For those of you on 2016.3, you can map themes to Darcula right in the TextMate Bundles screen. It's no longer in "Editor". – Eric Keyte Dec 13 '16 at 16:44
CrazyCoder's git repo doesn't work in windows systems, as a large number of the filenames are invalid in Windows.
I have, however, found the official repo for ruby for textmate:

- 7,470
- 3
- 38
- 54
-
Using Windows, worked for me, thanks! File -> Settings -> Textmate Bundles. Click + (top right), select local clone of ruby.tmbundle. Click OK. Didn't even need to restart PHPStorm. – fazy Jun 06 '14 at 08:48
I actually copied over my PhpStorm theme to RubyMine with no issue, so it should go both ways.
I went as far as to create a TextMate keymap for PhpStorm as well, you can take a look here: http://tentaclecms.com/blog/2013/08/textmate-keymap-for-phpstorm/

- 651
- 5
- 11