This exact request (even up to the fact that Dr Scheme motivated it) is what finally pushed me to learn Emacs.
Here's what i did to install it under Windows Vista:
Download Emacs from http://ftp.gnu.org/gnu/windows/emacs/emacs-22.3-bin-i386.zip
Unzip it to the directory of your choice
After unzipping it create an includes directory anywhere you wish and copy there both ruby-mode.el and ruby-inf.el (these come with the ruby distribution under the misc directory and can also be downloaded from Ruby's source
Modify your .emacs to tell it where to find your includes and and to use them
; directory to put various el files into
(add-to-list 'load-path "C:/emacs-22.3/includes")
;(1)modify .emacs to use ruby-mode
(autoload 'ruby-mode "ruby-mode"
"Mode for editing ruby source files" t)
(setq auto-mode-alist
(append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
(setq interpreter-mode-alist (append '(("ruby" . ruby-mode))
interpreter-mode-alist))
;(2)set to load inf-ruby and set inf-ruby key definition in ruby-mode.
(autoload 'run-ruby "inf-ruby"
"Run an inferior Ruby process")
(autoload 'inf-ruby-keys "inf-ruby"
"Set local key defs for inf-ruby in ruby-mode")
(add-hook 'ruby-mode-hook
'(lambda ()
(inf-ruby-keys)
))
(optional) I also installed mode-compile.el from http://perso.tls.cena.fr/boubaker/distrib/mode-compile.el and made the corresponding edits in .emacs
; Install mode-compile
(autoload 'mode-compile "mode-compile"
"Compile current buffer based on the major mode" t)
(global-set-key "C-cc" 'mode-compile)
(autoload 'mode-compile-kill "mode-compile"
"Kill compilation launched by `mode-compile'" t)
(global-set-key "C-ck" 'mode-compile-kill)
With those changes Emacs will automatically identify a .rb file as ruby and do syntax highlighting. Then with the chord \C-c\C-s (Control-c, release and then Control-s) irb will start in the box below your file, and you can use all the keys defined by inf-ruby: (\M is the Meta Key which for Windows means Alt)
"\C-c\C-b" 'ruby-send-block
"\C-c\M-b" 'ruby-send-block-and-go
"\C-c\C-x" 'ruby-send-definition
"\C-c\M-x" 'ruby-send-definition-and-go
"\C-c\C-r" 'ruby-send-region
"\C-c\M-r" 'ruby-send-region-and-go
"\C-c\C-z" 'switch-to-ruby
"\C-c\C-l" 'ruby-load-file
"\C-c\C-s" 'run-ruby
If you did the optional step and installed mode-compile, you can also use \C-cc to send the current file to ruby instead of irb