# Apache using older ruby

**URL:** <https://www.ruby-forum.com/t/apache-using-older-ruby/99828>\
**Category:** Ruby\
**Created:** [July 25, 2006, 8:03pm UTC](https://www.ruby-forum.com/t/apache-using-older-ruby/99828 "2006-07-25T20:03:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxbohr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f4b2a3/32.png) [@maxbohr](https://www.ruby-forum.com/u/maxbohr)\
**Post date:** [July 25, 2006, 8:03pm UTC](https://www.ruby-forum.com/t/apache-using-older-ruby/99828/1 "2006-07-25T20:03:41Z")

</div>

Hello List,  
I’m running into some problems serving rhtml files on OSX Tiger. I’m a  
bit of a noob so I apologize if the answer to my question is an obvious  
one. I have both 1.8.2 and 1.8.4 installed on my computer. I setup my  
environment(I think) to use .4 if I start ruby up in bash:

ruby -v  
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.6.0]

but RUBY\_VERION in an rhtml file says .2

I’m also unsure of how to include gems in my rhtml file.

\<%  
require ‘rubygems’  
require ‘active\_record’  
%\>

throws:  
###########  
Script Error

No such file to load – rubygems

Backtrace

(erb):3:in `require’  
(erb):3  
/Users/maxb/Sites/cgi-bin/erb.cgi:36  
##########

I used Martin Dittus’ howto when setting up apache  
[http://dekstop.de/weblog/2006/01/rhtml\_on\_osx\_with\_apache\_and\_erb/](http://dekstop.de/weblog/2006/01/rhtml_on_osx_with_apache_and_erb/)

best  
Max

---

<div class="post-metadata">

**Author:** ![maxbohr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f4b2a3/32.png) [@maxbohr](https://www.ruby-forum.com/u/maxbohr)\
**Post date:** [July 25, 2006, 8:27pm UTC](https://www.ruby-forum.com/t/apache-using-older-ruby/99828/2 "2006-07-25T20:27:58Z")

</div>

Max B. wrote:

> [Serving .rhtml Files on OS X With Apache and ERB - dekstop weblog](http://dekstop.de/weblog/2006/01/rhtml_on_osx_with_apache_and_erb/)
> 
> best  
> Max
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Open up Terminal.app and do “echo $PATH” then at the prompt do “which  
ruby”, notice which path is first and which ruby version shows up.  
Chances are you haven’t set your path correctly.

:Robert

---

<div class="post-metadata">

**Author:** ![maxbohr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f4b2a3/32.png) [@maxbohr](https://www.ruby-forum.com/u/maxbohr)\
**Post date:** [July 26, 2006, 11:23pm UTC](https://www.ruby-forum.com/t/apache-using-older-ruby/99828/3 "2006-07-26T23:23:53Z")

</div>

Robert H. wrote:

> Max B. wrote:
> 
> > [Serving .rhtml Files on OS X With Apache and ERB - dekstop weblog](http://dekstop.de/weblog/2006/01/rhtml_on_osx_with_apache_and_erb/)
> > 
> > best  
> > Max
> > 
> > –  
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> Open up Terminal.app and do “echo $PATH” then at the prompt do “which  
> ruby”, notice which path is first and which ruby version shows up.  
> Chances are you haven’t set your path correctly.
> 
> :Robert

Nope, I set the path correctly in my /etc/profile $PATH shows that the  
path is correct as does “which ruby” and “ruby -v”. Apache still likes  
the older one better.  
Best

---

<div class="post-metadata">

**Author:** ![maxbohr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f4b2a3/32.png) [@maxbohr](https://www.ruby-forum.com/u/maxbohr)\
**Post date:** [July 27, 2006, 3:03am UTC](https://www.ruby-forum.com/t/apache-using-older-ruby/99828/4 "2006-07-27T03:03:06Z")

</div>

On Jul 26, 2006, at 14:24, Max B. wrote:

> Nope, I set the path correctly in my /etc/profile $PATH shows that the  
> path is correct as does “which ruby” and “ruby -v”. Apache still likes  
> the older one better.

I’d suggest reviewing the recent discussion thread entitled “Mac OSX  
Ruby Configuration Question” that ran from July 18th to July 23rd. A  
lot of information about controlling the path under OSX was posted  
there.
