Categories
Emacs Programming Ruby on Rails

Can Your Editor Do This? Emacs for Rails Development

Here's a challenge for your Rails development environment: Can your editor run a web server inside itself, capture runtime errors as they happen, and automatically jump to the exact line of code that caused the problem?

If you're using TextMate, Vim without extensive configuration, or a basic text editor, the answer is probably no. But if you're using Emacs with Rinari, this is exactly what you get.

The Traditional Rails Workflow Problem

The typical Rails development workflow looks like this:

  1. Write code in your editor
  2. Switch to terminal and start the Rails server
  3. Switch to browser and trigger the action
  4. See an error in the browser
  5. Switch back to your editor
  6. Find the file and line number mentioned in the error
  7. Fix the problem
  8. Switch back to terminal and restart server
  9. Switch to browser and test again

That's a lot of context switching. Every error means bouncing between at least three different applications. It breaks flow and slows you down.

What Rinari Does Differently

Rinari is an Emacs mode specifically designed for Ruby on Rails development. It brings the entire Rails development workflow into your editor, eliminating most of that context switching.

The killer feature is integrated server management with error capture. You can start WEBrick or Mongrel directly inside Emacs. The server runs in an Emacs buffer, which means Emacs can parse the output in real-time.

When your Rails application hits an error, Rinari captures it, parses the stack trace, and lets you jump directly to the offending line with a single keystroke. No manually finding the file. No scrolling to line 47. Just instant navigation from error to source.

How It Works in Practice

Say you're working on a controller action and make a typo in a variable name. You trigger the action in your browser, and Rails throws a NameError.

In the traditional workflow, you'd read the error in the browser, note the file and line number, switch to your editor, open the file (if it's not already open), and navigate to the line.

With Rinari, the error appears in your Emacs buffer. You hit a keybinding, and Emacs instantly opens the file and positions your cursor at the exact line. Fix the typo, save, refresh the browser, done. The entire process takes seconds instead of the mental overhead of manual navigation.

Beyond Error Navigation

Rinari offers much more than error capture:

  • File navigation: Jump between models, views, controllers, and tests with dedicated commands
  • Console integration: Run Rails console inside Emacs
  • Test running: Execute tests without leaving your editor
  • Log tailing: View development logs in real-time
  • Rake integration: Run rake tasks from within Emacs

Combined with ruby-mode for syntax highlighting and indentation, Emacs becomes a complete Rails IDE without feeling heavy like Eclipse or NetBeans.

Why This Matters

Keeping everything in your editor isn't just about convenience—it's about maintaining flow. Every time you switch contexts, you lose a bit of focus. Every time you manually navigate to a file, you spend mental energy on navigation rather than problem-solving.

Rinari lets you stay focused on your code. The development server, error messages, logs, tests—everything is accessible without leaving Emacs. You think in code, not in application switching.

Getting Started

If you're interested in trying Rinari, check out the Emacs Wiki page for RubyOnRails for installation and configuration instructions.

Fair warning: if you're new to Emacs, there's a learning curve. But if you're already an Emacs user doing Rails development, Rinari is essential. It transforms Emacs from a text editor into a Rails development environment. Last modified: 2010-10-15 WordPress ID: 824

By Shishir Sharma

Shishir Sharma is a Software Engineering Leader, husband, and father based in Ottawa, Canada. A hacker and biker at heart, and has built a career as a visionary mentor and relentless problem solver.

With a leadership pedigree that includes LinkedIn, Shopify, and Zoom, Shishir excels at scaling high-impact teams and systems. He possesses a native-level mastery of JavaScript, Ruby, Python, PHP, and C/C++, moving seamlessly between modern web stacks and low-level architecture.

A dedicated member of the tech community, he serves as a moderator at LUG-Jaipur. When he’s not leading engineering teams or exploring new technologies, you’ll find him on the open road on his bike, catching an action movie, or immersed in high-stakes FPS games.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.