Rubymine >= 5.4.3.2.1 supports keybinding for "Goto next/previous splitter"

Rubymine supports keybinding to switch panes by hotkey like awesome window manager users are used to.

Type "splitter" in the top right keymap section search field (not the global settings search).

Note: A splitter is what you get after using split vertically or split horizontally.

How to not repeat yourself in Cucumber scenarios

It is good programming practice to Don't Repeat Yourself (or DRY). In Ruby on Rails we keep our code DRY by sharing behavior by using inheritance, modules, traits or partials.

When you reuse behavior you want to reuse tests as well. You are probably already reusing examples in unit tests. Unfortunately it is much harder to reuse code when writing integration tests with Cucumber, where you need t...

RubyMine detects syntax errors where there are none

To make this go away I had to wipe my RubyMine settings (~/.RubyMine) and configure everything again. Fun.

When RubyMine doesn't show you Git blames / annotate gutter not available

  • You probably haven't configured version control for your project.
  • Go to Project Settings / Version Control and set the director <Project> to Git

How to not leave trailing whitespace (using your editor or Git)

There is no reason to leave trailing whitespace characters in your project's files, so don't add any.

A git diff --check will tell you if there are any and you should not commit when you see them. So go ahead and switch your editor/IDE to automatically remove them for you.
Below are a few instructions on how to get them removed by your favorite IDE or editor.

Note that except for RubyMine, the following changes will remove trailing white-space on all lines, not only those that you changed.
While this should not be a problem if your proje...

RubyMine: Using pinned tabs will increase your productivity

I highly recommend that you make use of RubyMine's feature to pin tabs.

When you pin all "important" files, you can follow method definitions, wildly open files from search results and have a ton of open tabs -- without the problem of finding the stuff you were working on before.

Guide

  1. Pin the tabs of files that are currently in the focus of your work (important models, specs, etc):
    • Right-click a tab and select "Pin tab"
    • Or use a shortcut (see below)
  2. Work as usual.
  3. Once you opened other tabs because you searched ...

RubyMine: Set specific Ruby version per project

If your project uses another version than your default Ruby, RubyMine will give you incorrect inspections, for example.\
Here is how to switch which Ruby you use in RubyMine.

  1. File → Settings (Or press Ctrl+Alt+S)
  2. Select "Ruby SDK and Gems" from the left pane
  3. Switch your "Ruby interpreter".

Though it may seem you are changing a global setting here, this is in fact a per-project setting, as are all things you change in the "Project Settings [your_project_name]" area of the global settings dialog.

When you switch to another proje...

How to fix: RubyMine does not remember last used monitor (on Ubuntu)

Every time I started RubyMine, it opened the main window on the left monitor -- when moving it to the center monitor and closing it, the next time it still opened up on the left one.

Here is how I forced RubyMine to start up on a different screen:

  1. Un-maximize the main window
  2. Move it to your preferred monitor
  3. Close RubyMine (keep it unmaximized)
  4. Start RubyMine again.
  5. You may now maximize your main window; the next time you start up RubyMine, it will open on the correct screen, maximized.

That's crazy!

RubyMine: Disable window animations

Under Settings / Appearance you can uncheck a box Animate windows. This will change your life.

This setting seems to not exist anymore.

RubyMine: Find and execute a menu action by its name

You are looking for a functionality in RubyMine but don't know or remember its keyboard shortcut or which menu it is located in?\
Hit Ctrl+Shift+A.

This will bring up the "Find Action" box where you can enter an action's name or category. Pick the result from the list to run it.

The list of results will also show you any assigned keyboard shortcuts.

rubymine-find-action.png

RubyMine: Exclude data and log directories from a project

RubyMine offers you to exclude directories from search, meaning faster search results and less "noise" in the list of result.

Right-click a folder in your project tree and click "Mark Directory As" → "Excluded".

Do it for your your log, data, and other directories that you don't need to access during development and whose search results are irrelevant.
They won't be deleted but simply ignored when searching across a project's files.

![](https://makandracards.com/makandra/6635-rubymine-exclude-data-and-log-directories-from-a-project/atta...

Using heredoc for prettier Ruby code

You can use heredoc to avoid endlessly long lines of code that nobody can read. Heredoc strings preserve linebreaks and can be used like this:

def long_message
  puts(<<-EOT)
    Here goes a very long message...
    Sincerely,
    foobear
  EOT
end

<<-EOT will be somewhat of a placeholder: anything you write in the line after you used it will be its value until you write EOT in a single line.

You can use any string to flag your heredocs. To be more verbose you...

Solarized color scheme for Rubymine

If you want to use the (badly implemented!) solarized color scheme in your Rubymine IDE:

  1. Clone the IntelliJ IDEA port:

    git clone https://github.com/jkaving/intellij-colors-solarized.git

  2. Import the settings in Rubymine by chosing the above directory File -> Import Settings

  3. Change the color scheme in the settings (Ctrl-Alt-S) in Editor -> Colors & Fonts

Note that selecting a color scheme will also reset your previous editor font choice. You might want to change the font to [Envy Code R](http://damieng.com/blog/2008/05/2...

RubyMine crashes Ubuntu 11.04 window decorator on exit

My RubyMine (and it seems like many other Java GUI applications) crashes the Compiz window decorator almost every time on exit. This also seems to happen for the Unity decorator.

Update: The commited fix from below seems to have made it into the stable Ubuntu repository.

Easy mode

You can restore window decorations by executing this command:

gtk-window-decorator --replace &

This is only a temporary fix.

Hard mode

Also, there is a committed fix that is n...

How to upgrade RubyMine

This card explains how to upgrade an existing RubyMine installation to a newer version. If you're installing RubyMine for the first time, see install RubyMine under Ubuntu. You might also consider installing RubyMine with snap, so it can receive automatic updates (also described in the install card).


This procedure ensures that an update does not totally break your IDE, as it allows you to keep both the previous and the new version of RubyMine:

  1. [Download the newest version](http://www.jetbrains.com/ruby...

Install RubyMine under Ubuntu

This card explains how to install RubyMine for the first time. If you want to upgrade an existing RubyMine installation (after legacy install) to a newer version, see How to upgrade RubyMine.


Option A (new way)

Ubuntu 16.04 comes with snap, a way to package software with all its dependencies. RubyMine is also packaged as a snap.

A snap will always track a channel (like stable, beta) and automatically update to the newest version available in this channel. By default the snap daemon will check for ...

Force RubyMine to notice file system changes

If you did file operations inside a shell or for example using Nautilus, it can take quite a while until RubyMine takes note of them and updates things like your project tree or its internal file list.

Flushing file system buffers helps you out (run it from a terminal):
sync

This is also possibly via the RubyMine menus: File → Synchronize.

Sun Java JVM/JRE on Ubuntu Linux

Note that you should disable the Java plug-in in your browsers after installation.

Ubuntu >= 12.04

Java 11

sudo apt install openjdk-11-jre-headless

Java 10

sudo add-apt-repository ppa:linuxuprising/java
sudo apt-get update
sudo apt-get install oracle-java10-installer

Java 8

You probably want to get rid of OpenJDK (which is installed by default and leads to bad RubyMine performance):

...

Enable tab dragging in RubyMine

Since RubyMine 3.1 you can drag tabs across panes/windows and out of the main window to create new windows.

For any version below 3.1 do it like this (will only allow dragging tabs inside their pane, not across panes):

  1. File → Settings
  2. Editor → Editor Tabs
  3. Check "Show tabs in single row"

Seriously.