Tony Pelaez's Blog

October 17, 2007

Rails on Emacs

Filed under: Rails, The Web.
Posted by Tony Pelaez @ 10:12 am

Gnu Emacs & Rails

Recently I’ve been doing a lot of Ruby on Rails development obsessively immersing myself in books to get to know the framework. I’ve gained a certain level of competence, and finished converting my website (except for this blog) to rails. Most of my development is done on my laptop which runs Windows XP. I had originally chosen Rad Rails with Aptana as my Integrated Development Environment (IDE). For those of you who don’t know, an IDE is a program used to develop program code that usually has special features like syntax highlighting, error correction, integrated compiling etc. that make it easier to develop with.

I really liked many of the features of Radrails, which took some of the repetative tasks in rials development and make simplified them. The biggest problem I had with Radrails is its speed. My computer is several years old now, and the program seems to load reeeaaaaalllllllyyyy slowly.

I’ve been known to be a little impatient, so I felt like I needed something faster. If you brows the web, most of the tutorials for rails have been created by developers using Textmate. Textmate is not a free program and only available for the mac. Furthermore, from what I’ve seen, Radrails seems to be nicer, in the fact that all the development tools are in one place and you don’t have to switch between windows constantly. But Textmate is respsonsive and fast. Searching on the Textmate site I noticed that it was influenced in design by Emacs.

The name rang a bell, and I remembered trying to run the program on my Ubuntu desktop and getting frustrated because I couldn’t immediately figure out how to use it. I came across this screencast and though “Wow, That is really cool!” So now it was a matter of downloading the program and installing it!

Well this didn’t turn out to be as easy as I had hoped it would be…..

My Emacs Layout
Click to view my Emacs Screenshot

Emacs is highly customizable which I’ve come to love, but which also makes it complicated to new users. So I’ve spent the whole day figuring out how to work it and customize it to what I need for rails development. Let me share with you what I’ve done:

  1. Install Emacs for Windows. Although you can download the program directly from GNU Emacs, I found the defaults in this installation much easier to work with.
  2. Follow This 5 Step Tutorial. I found this great tutorials after hours of scowring the web, but just getting more confused. It is pretty simple to follow, the only trouble I had with it was getting my folder in ecb to work when I clicked them with my mouse. Turns out its the middle mouse button that you have to press by default.
  3. I find putting line numbers in while viewing my code is helpful, so I also installed setnu.el.
  4. Since Emacs is highly customizable I wanted a simple way to customize views. I found color-theme which did just that

There is still a lot I have to learn about emacs, but I don’t think I will be switching back to Radrails anytime soon. I hope this information helps you explore Emacs and use it for your own Rails development.

Leave a Reply