If your Ruby project includes a gem like Spreewald that comes with some external step definition, RubyMine does not know about them by default and will highlight the step as an undefined reference:
To link these external step definitions to RubyMine, add the corresponding gems to your RubyMine-Settings:
ctrl + alt + s
)If your Rubymine does not recognize a file type correctly although you have entered the unmistakeable file extension like material_orders_controller.rb
, this may help you:
Sometimes you create a new file and forget to enter the ending like material_orders_controller
Rubymine handles such files per default as simple txt files.
You delete this file and create a new one with correct ending: material_orders_controller.rb
. But still Rubymine treats this file as text file, no highlighting is available.
What happene...
Since the Spell checker german dictionary plugin is not maintained anymore, here is another way to use a german dictionary.
Hunspell
plugin and restart Ruby Minesudo apt install hunspell-de-de
/usr/share/hunspell/de_DE.dic
in File > Settings > Editor > Spelling > Custom Directory +
![Screenshot_from_2018-10-17_16-47-03.png](https://makandracards.com/makandra/57341-rubymine-how-to-add-german-spell-checker...
When you find yourself constantly ignoring a RubyMine warning, you can simple disable that warning and de-clutter your editor. E.g. in my Cucumber scenarios RubyMine underlines 90% of all lines because it does not know about spreewald, making the file really hard to read.
You can disable any unwanted inspection by opening File / Settings / Editor / Inspections
and searching for the warning text.
What you disable or keep is up to your personal preference. I personally disable at least the following...
http://www.winedt.org/dict/de_neu.zip
unzip de_neu.zip
mkdir ~/Documents/dic
iconv -f UTF-16 -t UTF-8 de_neu.dic -o ~/Documents/dic/de_neu_utf8.dic
~/Documents/dic
If another session is accessing your database you are trying to reset or drop you might have seen the following error:
PG::ObjectInUse: ERROR: database "foo_development" is being accessed by other users
DETAIL: There is 1 other session using the database.
This could be the rails server, rubymine and many more. Beside terminating the session connection manually you can also find out the pid
and kill the process.
1. rails db
2. SELECT * FROM pg_stat_activity;
datid | 98359
datname | foo_developm...
Follow the instructions here.
PRs at makandra/rubocop-config are welcome. Also check the issue tracker.
Since version 2017-1 RubyMine runs cops in the background, and displays RuboCop offenses the same way as it does RubyMine inspections. (...
RubyMine provides a visual tool for resolving merge conflicts locally.
Follow
Git > Resolve Conflicts
in the context menu to open RubyMine's merge conflict tool.
You can also use a similar pane view to compare to files.
Mark two files and press Ctrl + D
to compare.
RubyMine allows bookmarking lines of code. This is super-helpful when working on a complex problem.
I've been using this feature for a few years now, and so should you! :)
Here are the default Linux/Windows keystrokes. See the documentation for other keybindings.
F11
A gray checkmark will be shown in the gutter on the left.
If you press F11
again on a bookmarked line, the bookmark will be removed.
Ctrl
...
Sometimes your code has long lines:
describe 'foo' do
describe 'bar' do
really_long_line_really_long_line_really_long_line
another_line
When you're working with multiple editor panes, such code will often be wider than the pane area:
describe 'foo' do |
describe 'bar' do |
really_long_line_really_long_|
another_line |
To help with this you can activate Soft wraps in the RubyMine options under General → Editor .
Your code will now look like this:
des...
Many of our developers love to use the "awesome" window manager on Linux. However, RubyMine dialogs occasionally defocus while typing.
Here is a fix for that, tested on awesome 3.4, 3.5 and 4.0 (Ubuntu 14.04 and 16.04).
Consider the following:
Ctrl
+Shift
+N
If your mouse pointer hovers the file list, the main window is focused when the list is being replaced (or simply when it shrinks and your mouse pointe...
When you paste copied code with CTRL+V
, RubyMine will change the indentation of the pasted code. You can prevent this by pasting with CTRL+ALT+Shift+V
instead ("Paste Simple").
To change this behavior entirely, you can open your settings and navigate to Editor / General / Smart Keys
. Here you can select one of three options for Reformat on paste
:
You might want to try "Indent Block".
From time to time, RubyMine suddenly did not accept any keyboard input and felt crashed, while mouse interaction was still possible. This apparently happens to all IntelliJ IDEs, especially on Ubuntu 14.04.
I've managed to fix it by having a shell script that exports XMODIFIERS=""
when launching RubyMine, like this:
#!/bin/sh
XMODIFIERS= /home/arne/rubymine/bin/rubymine.sh
It has been working reliably for me ever since, at least until RubyMine 8.
An alternate solution suggested on the [Jetbrains issue tracker](https://youtrack....
By pressing Ctrl
+ Shift
+ V
you can select a recently copied string for pasting.
CTRL + SHIFT + ALT + N
: Search for any symbol in your application, like CSS classes, Ruby classes, methods, helpers etc.
CTRL + SHIFT + N
: Search for filename in your application (also dependencies)
CTRL + E
: Open a list of recently opened files
ALT + POS1
: Open a the navigation bar as a context menu. Allows you to quickly navigate between files.
CTRL + G
: Go to line
CTRL + SHIFT + A
: Find ...
In my RubyMine I have recorded two macros for debugging and linked them to some keyboard shortcuts. Since I believe everyone could benefit from having those I wanted to share this.
The first one simply inserts
binding.pry
and the second one
.tap { |object| binding.pry }
for when you do not have a reference to the object you want to inspect.
In order to record a macro you simply follow the path Edit > Macros > Start Macro Recording
.
Then you simply type binding.pry
or whatever you want to record and stop recor...
To disable the mostly useless automatic suggestion popups in RubyMine, go to File / Settings, then to Editor / General / Code Completion and uncheck Auto-display code completion.
You can still open the popup by pressing CTRL + Space
. And you probably want to use Context-dependent word expansion instead, anyway.
I was annoyed that RubyMine's autocompletion did not work via Ctrl+Space for me. In fact, it did not work in any application.
Turns out that keyboard combination was hijacked by Ubuntu as it's the default for switching input languages (i.e. keyboard layouts). If you use only 1 language/layout, you will not notice except for the key not working.
To fix it, do the following:
ibus-setup
(e.g. from a terminal). This will open a GUI dialog.<Control>space
".There are times when you have a chunk of text that you want to do something with, e.g. replace something on it, or quickly edit it.
While you can open your favorite non-RubyMine editor for this, there is also a plugin: Scratch.
It allows RubyMine to open temporary files (actually they are saved, but somewhere inside the plugin's directory) so you don't need to switch to a text editor like gEdit that works differently and may not even offer what you are used to.
Note that RubyMine also offers so...
Code folding is a very useful feature to me. It gives me a quick overview over a file and keeps me from scolling like a hamster in its wheel.
Keyboard shortcuts:
strg -/+
strg ctrl -/+
When diving into Cucumber features or huge Ruby classes, I usually collapse all and the gradually expand what I need.
One of the many useful features of TextMate is autocompletion of words. If I were in TextMate right now, I could write "au[tab]", and it would complete it to "autocompletion". RubyMine can do this, too. When you write a word (e.g. a variable name), just hit ALT + / repeatedly and it will offer all completions for the letters you typed. This action is called Cyclic Expand Word in RubyMine / IntelliJ IDEA.
This feature keeps you from mistyping variable names, saves you keystrokes and speeds up development. ~10 keystrokes to the price ...
RubyMine 7.1:
Settings -> Editor -> General -> Smart Keys -> Unindent -> To nearest indent position
RubyMine 7.0:
Settings -> Editor -> General -> Smart Keys -> Backspace smart indent -> uncheck
Have you tried the Search everywhere dialog? You can open it by pressing Shift
twice.
We have released Modularity 2. It has many incompatible changes. See below for a script to migrate your applications automatically.
We now use traits with the vanilla include
method:
class Article < ActiveRecord::Base
include DoesTrashable
end
When your trait has parameters, use square brackets:
class Article < ActiveRecord::Base
include DoesStripFields[:name, :brand]
end
Note how you ...