Current Status of emacs support for rails projects

108 views
Skip to first unread message

Pedro Rolo

unread,
Apr 12, 2011, 6:17:04 AM4/12/11
to Rails On Emacs
Hello. Until now I've been using Netbeans for my RoR projects. Though,
Oracle has just announced that they are dropping this project, so I am
starting to look at other possibilities.

I am missing emacs since college, when I used to use it when coding
Lisp or C.

I would like to understand what's the current status of the rails
related emacs projects, to understand if emacs is now a decent
alternative to the modern IDEs...

I've been trying to have a look at rinari. though, it doesn't seem to
support rails 3. does it?

There are some key features that I'd like to have in emacs before I'd
use it for rails development. I wonder if they do work:

- Rails 3 support
- Tests support
- Rdebug support, à la GDB, both when running the server or tests

It would also be nice to have autocompletition.

Are there .els that support these features? which? and which versions
of these?

Thanks,
Pedro

Aleksandar Simic

unread,
Apr 12, 2011, 6:44:21 AM4/12/11
to emacs-o...@googlegroups.com
Hello Pedro,

I'm biased, I just use emacs.

So when you say: "to understand if emacs is now a decent alternative
to the modern IDEs" it shocks me that people use any IDEs at all or
that they are an alternative to emacs :)

Having said that, Rinari definitely does support Rails 3. See this:

https://github.com/erturne/rinari/commit/88cb12b9b9cc7932e2d6d969d4ab661d8c6d14f1

I use it with RSpec 2 & Cucumber and it works like a charm.

As for the rdebug setup, you can probably do it, haven't looked into it myself.

Thanks,
Aleksandar

Pedro Rolo

unread,
Apr 12, 2011, 2:07:05 PM4/12/11
to emacs-o...@googlegroups.com
Ok then... I have elpa installed (the emacs starter-kit to be more specific). So, I just copied the contents of eshulte's repository into my .emacs.d/elpa/rinari-2.1 and removed the elc files in the target directory. When running rinari-launch; rinari-web-server I got:

/home/pedrorolo/.rvm/rubies/ruby-1.8.7-p330/bin/ruby: No such file or directory -- /home/pedrorolo/workspace/alarms/script/server (LoadError)

I also made an attempt at removing elpa's rinari version and coping eschulte's into my .emacs.d. rinari-lauch ain't accessible then.

How should I install rinari given that i have the starter-kit installed?

Why isn't the rails3 version of rinari published in elpa?


2011/4/12 Aleksandar Simic <asi...@gmail.com>

Aleksandar Simic

unread,
Apr 12, 2011, 3:20:26 PM4/12/11
to emacs-o...@googlegroups.com
Hello Pedro,

On Tue, Apr 12, 2011 at 7:07 PM, Pedro Rolo <pedr...@gmail.com> wrote:
> Ok then... I have elpa installed (the emacs starter-kit to be more
> specific). So, I just copied the contents of eshulte's repository into my
> .emacs.d/elpa/rinari-2.1 and removed the elc files in the target directory.

in order not to get overwhelmed, try starting with a blank slate and
install just Rinari and add all the other packages as and when you
need them.

Add the paths to Rinari and jump explicitly in your init.el and then add this:

;; Rinari setup
(require 'jump)
(require 'rinari)

The type M-x eval-buffer. Go to a different buffer and type M-x
rinari-minor-mode.

If Rinari loads, then you have a good foundation to build upon.

> When running rinari-launch; rinari-web-server I got:
> /home/pedrorolo/.rvm/rubies/ruby-1.8.7-p330/bin/ruby: No such file or
> directory -- /home/pedrorolo/workspace/alarms/script/server (LoadError)

That depends on your Rails install. Emacs, or to be specific, rinari,
looks for that file in order to start the server, if it isn't there...
well it can't run.

Emacs (rinari) essentially does the following: it runs the scripts
that you would run on the command line, but in their own buffers. It
provides handy key bindings to do this automagically.

Thanks,
Aleksandar

Charles Magid

unread,
Apr 12, 2011, 5:00:01 PM4/12/11
to Pedro Rolo, Aleksandar Simic, emacs-o...@googlegroups.com, boston-r...@googlegroups.com
I start with this:


I find I do not use rinari nor emacs-rails, though I tried both extensively then abandoned them.  I added a list of some of the things I use instead below.

I find that peepopen is better for me(much faster navigation) than emacs class browser, or speedbar.  Especially when combined with Textmate.el


Here comes my list of customization pointers:

to navigate functions
(add-to-list 'load-path "~/.emacs.d/vendor/textmate.el")

to find across all loaded buffers
M-x multi-occur-in-matching-buffers

to find in project
(rgrep "a" "* .*" "~/rails_project/app/" nil); ie M-x rgrep

I bought this, though it could use loads of love(fuzzy selection), I still recommend it.  
(require 'peepopen)

I change the tab default from 4 ;(
(setq-default tab-width 2)

Rare but Textmate also offers another nicity to emacs. 
(require 'wrap-region)

;; fuzzy selection
(require 'ido) 
(ido-mode t) 

This turns emacs into a ruby on rails ide (imho) Simple way to see where method/action/function/or any scoped object starts and ends.
jao-selective-display

;; show ruby methods in menubar.  The textmate mode is better but this give you a rescan buffer option
(eval-after-load 'ruby-mode
  '(add-hook 'ruby-mode-hook 'imenu-add-menubar-index))

;; I use yasnippets
; As soon as you know how to add snippets rails2 rails3 who cares ;)

;; load the set of saved files on startup
(require 'save-visited-files)
(turn-on-save-visited-files-mode)

--
Charles M Magid

Company: Snowy Owl Consulting - http://snowy-owl.com
Twitter: http://twitter.com/Charles_Magid
GitHub: http://github.com/ChasManRors
Facebook: http://www.facebook.com/charles.magid?v=info
Skype: cmmagid
Phone: 781 861-5088 [Best Option]
Cell:    508 572-1891
Google Voice: 931 996-2443


Reply all
Reply to author
Forward
0 new messages