# How do I use Erubis?

**URL:** <https://www.ruby-forum.com/t/how-do-i-use-erubis/158698>\
**Category:** Ruby\
**Created:** [January 26, 2009, 11:26pm UTC](https://www.ruby-forum.com/t/how-do-i-use-erubis/158698 "2009-01-26T23:26:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Post date:** [January 26, 2009, 11:26pm UTC](https://www.ruby-forum.com/t/how-do-i-use-erubis/158698/1 "2009-01-26T23:26:12Z")

</div>

I have been using eruby for embedded ruby in html, and I am moving to a  
new server and am interested in using erubis instead - how do I do that?  
Do I just install the rubygem and my .rhtml files should work the same  
way as with eruby?

---

<div class="post-metadata">

**Author:** ![jonathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Post date:** [January 27, 2009, 9:38am UTC](https://www.ruby-forum.com/t/how-do-i-use-erubis/158698/2 "2009-01-27T09:38:45Z")

</div>

Jonathan D. wrote:

> I have been using eruby for embedded ruby in html, and I am moving to a  
> new server and am interested in using erubis instead - how do I do that?

To paraphrase: you are asking “how to I get my webserver to use erubis  
instead of erb”?

This question can’t be answered without knowing what webserver you’re  
using.

If you show how you’ve got your current webserver set up to use eruby,  
then it may be clear how to change it to use erubis.

If you’re using Apache with mod\_ruby, the erubis documentation explains  
how to do it here:  
[http://www.kuwata-lab.com/erubis/users-guide.06.html#topcs-modruby](http://www.kuwata-lab.com/erubis/users-guide.06.html#topcs-modruby)

> Do I just install the rubygem and my .rhtml files should work the same  
> way as with eruby?

Well, why not just try it. If it fails then you can show a specific  
problem:

“I have been using eruby successfully with config X. I changed this to  
config Y to try to use erubis, but then I got error message Z” - showing  
all of X, Y and Z.

Having narrowed down your problem like this, and provided all the  
context, it makes it much easier for someone to help you.
