I recently noticed that better_errors
allows you to to
open files from within your favorite editor
Show archive.org snapshot
. However it was not so easy to get rubymine://
links to work on Gnome/Linux. Here is how it finally worked for me:
Add this file to ~/.local/share/applications/rubymine.desktop
:
[Desktop Entry]
Version=1.0
Type=Application
Encoding=UTF-8
Name=Rubymine
Exec=sh -c '/snap/bin/rubymine ${0#"rubymine://"}' %u
Terminal=false
StartupNotify=false
Categories=Application;
MimeType=x-scheme-handler/rubymine;
Note the Exec
madness:
which rubymine
) depending on how you have installed rubyminerubymine://Gemfile
. We have to strip the protocolrubymine://
prefix is thus stripped from %u
using some weird
shell parameter expansion
Show archive.org snapshot
syntaxrubymine
mime type to the new launcher Add the following to ~/.config/mimeapps.list
:
x-scheme-handler/rubymine=rubymine.desktop
gio mime x-scheme-handler/rubymine
suggest Registered applications: rubymine.desktop
?xdg-open "rubymine:///etc/hosts"
open the hosts-file in RubyMine?The BETTER_ERRORS_EDITOR_URL Show archive.org snapshot environment variable can be used to tweak better_errors:
export BETTER_ERRORS_EDITOR_URL="rubymine://%{file_unencoded}"
Restart your server (in a new terminal!) and add a raise
statement to your local application.Does better_errors link to your file system?
Make sure that better_errors is at least on Version 2.9 or newer, the BETTER_ERRORS_EDITOR_URL variable was introduced in 2020.