Turbocharge your Emacs for Ruby on Rails with rinari and rails-reloaded
Rinari is an Emacs minor mode that is aimed towards making Emacs into a top-notch Ruby and Rails development environment.
Rails reloaded is the minor mode for editing Ruby On Rails code with Emacs. This
minor mode makes your work much easier and user friendly.
Lets first install rinari:
cd ~/.emacs.d/ git clone git://github.com/eschulte/rinari.git cd rinari git submodule init git submodule update
( Curious about git submodules? Read here http://book.git-scm.com/5_submodules.html )
And why not do yum install emacs-rinari? Because it gives me an error:
Symbol's value as variable is void: inflection-uncountables
Next, install rails-reloaded:
cd ~/.emacs.d/ git clone git://github.com/dima-exe/emacs-rails-reloaded.git rails-reloaded
Edit ~/.emacs file now to add these modules.
This is how how my .emacs file looks now:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; START: Ruby / Rails setup ;; Interactively Do Things (highly recommended, but not strictly required) (require 'ido) (ido-mode t) ;; Rinari (setq load-path (cons (expand-file-name "~/.emacs.d/rinari") load-path)) ;; (add-to-list 'load-path "~/.emacs/rinari") (require 'rinari) ;; rails reloaded plugin (setq load-path (cons (expand-file-name "~/.emacs.d/emacs-rails-reloaded") load-path)) (require 'rails-autoload) ;; END: Ruby / Rails setup ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Next bytecompile, press [M-x] and type rails/bytecompile.
Thats it!
Screen cast of rinari in action: http://vimeo.com/2854412
Rinari Screencast (Ruby on Rails development with Emacs) from Eric Schulte on Vimeo.
Read the documentation for more:
https://github.com/dima-exe/emacs-rails-reloaded/blob/master/README
Sayth 11:30 am on December 31, 2012 Permalink |
What does rails-reloaded add that rinari didn’t do?
tuxdna 6:03 am on January 3, 2013 Permalink |
@Sayth: I used both of these over 1 year ago. I guess, rails-reloaded has support for adding code snippets among other things. The features are clearly listed here – https://github.com/dima-exe/emacs-rails-reloaded/blob/master/README
For a documentation of rinari you can have a look here – http://tuxdna.in/files/rinari.html ( generated from https://github.com/eschulte/rinari/blob/master/doc/rinari.texi )
I hope that helps 🙂
Dmitry Gutov 2:15 pm on January 3, 2013 Permalink
The documentation on the official site is generated from the same file, and looks a bit better: http://rinari.rubyforge.org/
It is somewhat outdated, too, though.
Dmitry Gutov 2:57 pm on January 2, 2013 Permalink |
Warning for anyone reading this now: emacs-rails-reloaded is old, outdated, and unsupported.
Install it on your own risk.
tuxdna 6:08 am on January 3, 2013 Permalink |
@Dmitry: rails-reloaded had its last commit 4 years ago. It is not as popular as rinari. If you notice there is only 1 issue filed against rails-reloaded but for rinari there are 9 issues still pending ( see their github repos ). Which, indicates the popularity of rinari. But does that mean it is outdated? I guess rails-reloaded needs a new maintainer. Or perhaps merging the features of both rinari and rails-reloaded into either of these 🙂
Thanks for pointing it out.
Dmitry Gutov 2:06 pm on January 3, 2013 Permalink
It is outdated. Here’s a recent complaint: http://stackoverflow.com/questions/13890831/emacs-rails-reloaded-does-not-work
Looking at the code that launches the console, it a) should be trivially fixable, but no one bothered, b) tries to run “script/console”, so it’s targeting Rails 2 or something.
And there are some things there that could be nice to have (like cached rake tasks listing), but similarly don’t work well.
tuxdna 6:12 am on January 3, 2013 Permalink |
For me, these two modes pertty much suffice: ruby-mode and ido-mode 🙂
http://stackoverflow.com/questions/10930805/how-do-i-install-ruby-mode-for-emacs
http://emacswiki.org/emacs/InteractivelyDoThings
Dmitry Gutov 2:07 pm on January 3, 2013 Permalink |
What, no project management or test launcher? 🙂
Are you really writing web apps?