After I installed the fantastic better_errors gem, I was disappointed to notice that linking to your text editor doesn't work correctly on Ubuntu (at least, it didn't for me). Here's how I fixed it.
First, create a new desktop entry:
# /usr/share/applications/subl-urlhandler.desktop