Skip to content

Instantly share code, notes, and snippets.

@uskanda
Created November 23, 2011 22:54
Show Gist options
  • Save uskanda/1390182 to your computer and use it in GitHub Desktop.
Save uskanda/1390182 to your computer and use it in GitHub Desktop.
[Emacs]Auto RVM switcher (when start up inf-ruby, rails console, webserver)
;; dependency: rvm rinari
(defadvice rinari-web-server (before rvm-switch-rinari-web-server)
(rvm-activate-corresponding-ruby))
(ad-activate 'rinari-web-server)
(defadvice rinari-console (before rvm-switch-rinari-console)
(rvm-activate-corresponding-ruby))
(ad-activate 'rinari-console)
(defadvice run-ruby (before rvm-switch-run-ruby)
(rvm-activate-corresponding-ruby))
(ad-activate 'run-ruby)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment