# Ruby scripting support for Emacs

**URL:** <https://www.ruby-forum.com/t/ruby-scripting-support-for-emacs/58634>\
**Category:** Ruby\
**Created:** [April 24, 2006, 10:48am UTC](https://www.ruby-forum.com/t/ruby-scripting-support-for-emacs/58634 "2006-04-24T10:48:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@alder](https://www.ruby-forum.com/u/alder)\
**Post date:** [April 24, 2006, 10:48am UTC](https://www.ruby-forum.com/t/ruby-scripting-support-for-emacs/58634/1 "2006-04-24T10:48:12Z")

</div>

Hi

Is there a way to use Ruby as a scripting language for Emacs?

(There’s a way to use Python for that [1], but I haven’t managed to  
find the equivalent for Ruby)

-Alder

[1] Pymacs: [http://pymacs.progiciels-bpi.ca/](http://pymacs.progiciels-bpi.ca/)

---

<div class="post-metadata">

**Author:** ![alder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@alder](https://www.ruby-forum.com/u/alder)\
**Post date:** [April 24, 2006, 4:10pm UTC](https://www.ruby-forum.com/t/ruby-scripting-support-for-emacs/58634/2 "2006-04-24T16:10:40Z")

</div>

Alder G. wrote:

> Hi

Hello.

> Is there a way to use Ruby as a scripting language for Emacs?

Try EL4R: Emacs Lisp for Ruby,

[http://www.rubyist.net/~rubikitch/computer/el4r/index.en.html](http://www.rubyist.net/~rubikitch/computer/el4r/index.en.html)

Regards,

---

<div class="post-metadata">

**Author:** ![alder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@alder](https://www.ruby-forum.com/u/alder)\
**Post date:** [April 24, 2006, 6:39pm UTC](https://www.ruby-forum.com/t/ruby-scripting-support-for-emacs/58634/3 "2006-04-24T18:39:46Z")

</div>

On Apr 24, 2006, at 10:47 AM, Alder G. wrote:

> Is there a way to use Ruby as a scripting language for Emacs?
> 
> (There’s a way to use Python for that [1], but I haven’t managed to  
> find the equivalent for Ruby)
> 
> -Alder
> 
> [1] Pymacs: [http://pymacs.progiciels-bpi.ca/](http://pymacs.progiciels-bpi.ca/)

The emacs wiki is pretty comprehensive when searching for stuff like  
this:

[http://www.emacswiki.org/cgi-bin/wiki/EmacsRuby](http://www.emacswiki.org/cgi-bin/wiki/EmacsRuby)

– Daniel

---

<div class="post-metadata">

**Author:** ![alder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@alder](https://www.ruby-forum.com/u/alder)\
**Post date:** [April 24, 2006, 6:55pm UTC](https://www.ruby-forum.com/t/ruby-scripting-support-for-emacs/58634/4 "2006-04-24T18:55:14Z")

</div>

On 4/24/06, Bil K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ## Regards,
> 
> Bil  
> [http://fun3d.larc.nasa.gov](http://fun3d.larc.nasa.gov)

Thanks, Bil

EmacsRuby is truly what I was looking for. Unfortunately, it seems to  
have some problems working on the Windows platform. Since the author  
expressed interest in attempts to run EmacsRuby under Win32, I sent  
him a detailed account of the problems I encountered. I’ll attach it  
here, maybe someone would benefit:

To: EmacsRuby’s author  
Subject: EmacsRuby on Windows

Hi there

You mentioned in EmacsRub’s homepage that you don’t have access to a  
Windows machine. I have Windows XP Pro as my desktop workstation, so  
I’ll share my attempt to install EmacsRuby on Windows. Ruby version:  
ruby 1.8.4 (2005-12-24) [i386-mswin32] (pretty much the current stable  
standard)

1. Attempting to download and install EmacsRuby in the recommended way:

ruby -ropen-uri -e  
‘URI(“[http://www.rubyist.net/~rubikitch/archive/el4r-1.0.3.tar.gz](http://www.rubyist.net/~rubikitch/archive/el4r-1.0.3.tar.gz)”).read.display’

> el4r-1.0.3.tar.gz

doesn’t work. The resulting local file el4r-1.0.3.tar.gz is  
corrupted for some reason (manual download through the browser worked,  
however).

1. Windows machine don’t normally have tar (I do), let along the tar +  
gzip combination (even I don’t :-(), so trying to expand through:

tar xzf el4r-1.0.3.tar.gz

doesn’t work. Have you considered a gem or at least a Zip release?

1. Running setup.rb worked. However File.expand\_path(“~”) didn’t work  
within the various files in bin. Strangely enough,  
File.expand\_path(“~”) worked fine in IRB, but trying  
File.expand\_path(s) where s contains the ~ character produced the  
following exception trying to run the first of two setup-lines (“ruby  
-S el4r-rctool -p”):

C:/ruby/bin/el4r-rctool:189: (eval):1:in `expand_path': couldn't find HOME environment -- expanding `~/.el4r’ (ArgumentError)  
from (eval):1

I solved this by replacing within el4r-rctool all “~” in paths to “/”,  
which is the directory Emacs uses as HOME. After that, the two setup  
lines:

ruby -S el4r-rctool -p  
ruby -S el4r-rctool -i

executed appearantly without exception.

But when I entered Emacs and ran el4r-boot, I got a message:

“el4r instance dead”

At that point, I tried running the tests:

ruby bin/el4r-runtest testing/test-el4r.rb --batch -l testlog  
–emacs=[emacs binary name]

but again received the exception “couldn’t find HOME environment”.

At this point I gave up ☹

Please let me know if there’s anything I can do to help you stabilize  
el4r for Windows, since I’m very interested in programming Emacs with  
Ruby.

Regrads,  
Alder
