What do you use to edit Ruby and Ruby on Rails code? Chances are very good that you use a text editor. There are plenty of choices out there, TextMate is very popular on OS X, Sublime Text is available everywhere, and even editors like GEdit, which comes with most Linux distros, can be used effectively. And of course we can't forget the "big two," Vim and Emacs. But how many of you use an IDE? If you're anything like me, I didn't even consider using an IDE. I just didn't see the need, I thought it would add a lot of unncessary complication to something so well suited to a plain editor. Well, RubyMine 5.0 was recently released, and I decided to take it for a spin.
JetBrains is most famous for their Java IDE IDEA, but they also offer IDEs for PHP, Python, HTML5 and of course Ruby. RubyMine is part of the IntelliJ family of IDE products from JetBrains. The platform on which the RubyMine IDE is based is therefore very stable and mature, being based on an IDE platform that's been in constant development since 2001. It's suitable for editing normal Ruby code as well as developing full-blown Rails projects.
RubyMine offers a host of features useful to any Ruby or Ruby on Rails developer. These features range from the big (Rails integration) to the small (Ruby syntax highlighting), but all of them are a constructive addition to Ruby development.
Rails Integration - RubyMine offers full Rails integration. This includes everything from generating a new Rails project, running Rails commands like generators, the console, the server, rake tasks, etc to navigating in your Rails projects. There are dialogs for all the generators, autocompletion for the rake tasks, etc. There's even autocompletion for generating scaffolding/migration fields.
Perhaps most importantly, RubyMine understands the relationships between files in Rails projects and gives you many tools to quickly switch between files. For example, when pressing Ctrl-Alt-N, you can type the name of any file, or part of the name, or even little shortcuts like simply typing p_c to go to posts_controller.rb. In controllers, there are links next to the line numbers to jump to the associated view. A lot of work went into getting around in Rails projects, and once you learn some of the shortcuts you can get around very effectively.
Git Integration - RubyMine integrates with Git very well, as well as several other VCS systems. You can initialize git repositories and make commits, as well as just about every other feature you'll use on a daily basis. When committing, you can select which changes you want to commit, there's a graphical diff viewer and it's easy to add untracked files. It's also easy to work with branches, push to GitHub (or presumably any other remote you set up), create and apply patches, etc. I rarely found myself going back to the command line to input any git commands. The only thing I couldn't figure out how to do was to tag a commit and push all tags, so it's not 100% complete integration and you may find yourself needing the terminal, but for daily tasks it's more than sufficient. You can also post any file or selection onto Gist with the right click menu.
IRB Console - This might sound like a small feature, but if you open up an IRB console (right in the Tools menu), you can load any file into that IRB window using Ctrl-Shift-L. This makes a very nice workflow for working with individual Ruby files, keeping you in the same window looking at the IRB console and the code at the same time. However, I did manage to break this once by accidentally calling puts in an infinite loop. This froze the IRB window and I was unable to fix it without restarting RubyMine. However, this is the only time I was able to get the IDE to break or crash in any way.
Visual Debugging - This is something I've always wanted in Ruby. While this feature is not 100% solid, it does work very well. You can set breakpoints, step through Ruby code, examine and modify variables, etc. However, and this is a weakness with Ruby and debugging in general, a lot of statements like long method call chains just don't debug well, stepping over the entire thing with a single step. The same with complex statements. I could find no way to break into these and see them run step by step. However, it's much easier to use than the command line debuggers, and is a useful feature.
General Editing - Everything having to do with editing Ruby works well in RubyMine. It syntax highlights correctly, but beyond that it features very customizable code styles. You can tell it whether you indent you when clauses in a case, how far to indent, whether to use spaces or tabs, etc. Other files highlight and autocomplete well, including erb files, HTML and CSS, Haml and Sass, etc. RubyMine supports colorschemes and comes with a few good ones by default, however most of them are dark and their new "Darcula" theme is not to my liking. But someone ported Solarized to RubyMine, so I have my normal color scheme. And this may be a minor point for some, but I found the font rendering to be too different. The fonts are rendered using a Java API instead of the system font rendering and they're not bad font renderings, but I prefer Ubuntu's font renderer. This is a minor point though.
Code Inspector - RubyMine also features a code inspector, which at times can be annoying. It'll underline things like double-quoted string literals with no interpolation inside, incorrect method calls, etc. But it's pretty smart, when you're referring to a method in something like a before_filter line, RubyMine knows what type of method that should be and underlines methods it can't find. It'll also underline other related things like in :except => [:index,:get] on a before_filter line. I had meant to say :show, RubyMine knows that's a list of actions for that controller, knows there's no :get action and underlines it. However, it doesn't know about programatically generated methods like those from Devise, and always underlines them. So this feature is not 100% useful, and some might want to turn it off or spend some time tweaking its configuration to their liking.
RVM Integration and Ruby 2.0 - RubyMine knows about RVM, and allows you to configure which Ruby you want to use for each project. It even knows about gemsets. There's also Ruby 2.0 support, and that's not even (officially) out yet. I was surprised by this, and though it was a really nice touch.
Testing and Code Coverage - You can run your tests with code coverage very easily. Code coverage is graphical, showing you how many times a line was hit next to the line number and give you coverage summaries of how many lines in each file or directory are covered.
Diagrams - RubyMine can spit out graphical diagrams of a number of things. For example, gem dependency diagrams, class hierarchies, Rails model relationship diagrams, etc. In larger projects with complex relationships, this can be a big plus.
TODO - If you put TODO (or any other configurable phrase) into your code, RubyMine tracks this and give you a todo list. While you can easily do this from the command line with grep, it's yet another reason to never leave the IDE.
RubyMotion Support - I have never used RubyMotion, so I cannot comment on how well this feature really works, but it's worth mentioning. See their demo for a good idea what it's all about.
Overall, the feature set is impressive, useful and my impression of them is very positive. I found it difficult to find any major downsides or bugs. However, here are a few minor bad things I found.
- The interface for importing an existing Git repository from GitHub as a project was a bit fickle. It had trouble selecting the right directory, to do this I manually clone it from the command line and then open it with RubyMine now.
- RubyMine sometimes loads the wrong files. If I have the file lib/something/file.rb open and I close RubyMine, it will sometimes load lib/something_else/file.rb. Same filename, different directory. If the files you have are very similar, this can be a problem.
- The fonts don't look quite right. Not bad, but it doesn't use the system's font rendering, it's doing something in Java. I tried to load the Inconsolate OTF font and it failed to do so, I had to find a TTF. It's all workable, just a bit different.
- It keeps trying to add .idea project files to Git. Whether you want to do this is up to you, but even after adding it to .gitignore I found it still tried to add them since they were in the repository before. However, if you're working on a team, the .idea files (which hold the IDE configuration for that project) will help the entire team stay on the same IDE configuration.
RubyMine is something you'll really like if you're looking for a generic Ruby or Ruby on Rails IDE. It has an impressive feature set and, more importantly, these features actually work. When starting to use RubyMine, I was not optimistic. As mentioned in the beginning of this review I'm a long time Vim user, but I just can't help but be impressed. A lot of you out there won't like this, you won't want an IDE of any kind and will never leave your editors. Whether this is for practical or ideological reasons, I urge you to step outside your comfort zone and try something wholly unfamiliar to many Ruby programmers: an actual IDE. Because RubyMine is good and the trial is free.
The final thing to talk about is the price. RubyMine is free for 30 days, but after that it costs $100 for a single developer and $60 a year for upgrades each year after that. This sounds like a lot if you're a Vim or Emacs user, your editor has and always will be free, but RubyMine offers features you'll spend a lot of time setting up, configuring or, if they don't yet exist, programming. This is a canned solution, just install RubyMine and you're off. Competing commercial editors such as TextMate and Sublime Text don't cost much less ($59 and $70 respectively), so the price is quite competitive considering RubyMine offers most (if not all) the features of these editors plus quite a lot more. I personally think the cost is worth it, especially if you'll be spending a lot of time working or Ruby or Rails code.
So the final score for RubyMine 5.0 is a 4.5 with a caveat: some people certainly aren't going to like it because they're not going to like any IDE. For the rest of you, I can't say enough good things about RubyMine.