# Rhtml can't find rubygems

**URL:** <https://www.ruby-forum.com/t/rhtml-cant-find-rubygems/99542>\
**Category:** Ruby\
**Created:** [July 24, 2006, 12:10am UTC](https://www.ruby-forum.com/t/rhtml-cant-find-rubygems/99542 "2006-07-24T00:10:01Z")\
**Posts on this page:** 8\
**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 24, 2006, 12:10am UTC](https://www.ruby-forum.com/t/rhtml-cant-find-rubygems/99542/1 "2006-07-24T00:10:01Z")

</div>

I’m having some problems including rubygems in rhtml files. I’m on OSX  
Tiger and I set up apache to serve rhtml files(herein may lie the  
problem). While certain libs load fine ie ‘open-uri’ attempting to  
require ‘rubygems’ like so:

##############  
\<%  
require ‘open-uri’  
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

Environment

DOCUMENT\_ROOT = /Library/WebServer/Documents  
HTTP\_ACCEPT =  
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,_/_;q=0.5  
HTTP\_ACCEPT\_CHARSET = ISO-8859-1,utf-8;q=0.7,\*;q=0.7  
HTTP\_ACCEPT\_ENCODING = gzip,deflate  
HTTP\_ACCEPT\_LANGUAGE = en-us,en;q=0.5  
HTTP\_CONNECTION = keep-alive  
HTTP\_HOST = 127.0.0.1  
HTTP\_KEEP\_ALIVE = 300  
HTTP\_USER\_AGENT = Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US;  
rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4  
PATH =  
/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices  
REDIRECT\_SCRIPT\_URI =  
[http://max-benjamins-computer.local/~maxb/wheresTheBeef.rhtml](http://max-benjamins-computer.local/~maxb/wheresTheBeef.rhtml)  
REDIRECT\_SCRIPT\_URL = /~maxb/wheresTheBeef.rhtml  
REDIRECT\_STATUS = 200  
REDIRECT\_URL = /~maxb/wheresTheBeef.rhtml  
REMOTE\_ADDR = 127.0.0.1  
REMOTE\_PORT = 56404  
SCRIPT\_FILENAME = /Users/maxb/Sites/cgi-bin/erb.cgi  
SCRIPT\_URI =  
[http://max-benjamins-computer.local/~maxb/wheresTheBeef.rhtml](http://max-benjamins-computer.local/~maxb/wheresTheBeef.rhtml)  
SCRIPT\_URL = /~maxb/wheresTheBeef.rhtml  
SERVER\_ADDR = 127.0.0.1  
SERVER\_ADMIN = [no address given]  
SERVER\_NAME = max-benjamins-computer.local  
SERVER\_PORT = 80  
SERVER\_SIGNATURE =  
Apache/1.3.33 Server at max-benjamins-computer.local Port 80

SERVER\_SOFTWARE = Apache/1.3.33 (Darwin) PHP/5.1.2  
GATEWAY\_INTERFACE = CGI/1.1  
SERVER\_PROTOCOL = HTTP/1.1  
REQUEST\_METHOD = GET  
QUERY\_STRING =  
REQUEST\_URI = /~maxb/wheresTheBeef.rhtml  
SCRIPT\_NAME = /~maxb/cgi-bin/erb.cgi  
PATH\_INFO = /~maxb/wheresTheBeef.rhtml  
PATH\_TRANSLATED = /Users/maxb/Sites/wheresTheBeef.rhtml

/Users/maxb/Sites/cgi-bin/erb.cgi – Sun, 23 Jul 2006 21:54:56 GMT  
#############

Best  
M

---

<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 24, 2006, 1:42am UTC](https://www.ruby-forum.com/t/rhtml-cant-find-rubygems/99542/2 "2006-07-24T01:42:08Z")

</div>

is rubygems a library? is so, giving the full unix path might solve  
your problem for now?

what is your $PATH? are you using 1.8.2 or 1.8.4?

---

<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 24, 2006, 11:55pm UTC](https://www.ruby-forum.com/t/rhtml-cant-find-rubygems/99542/3 "2006-07-24T23:55:15Z")

</div>

anne001 wrote:

> is rubygems a library? is so, giving the full unix path might solve  
> your problem for now?
> 
> what is your $PATH? are you using 1.8.2 or 1.8.4?

Hmm. I have both versions, gems being installed for 1.8.4. Checking  
RUBY\_VERSION in an rhtml file apache appears to be using the older  
verion while running ruby -v in bash it’s .4 can anyone tell me where I  
need to make changes so that systemwide I’m using .4. httpd.conf?

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, 12:18am UTC](https://www.ruby-forum.com/t/rhtml-cant-find-rubygems/99542/4 "2006-07-25T00:18:36Z")

</div>

Max B. wrote:

> anne001 wrote:
> 
> > is rubygems a library? is so, giving the full unix path might solve  
> > your problem for now?
> > 
> > what is your $PATH? are you using 1.8.2 or 1.8.4?
> 
> Hmm. I have both versions, gems being installed for 1.8.4. Checking  
> RUBY\_VERSION in an rhtml file apache appears to be using the older  
> verion while running ruby -v in bash it’s .4 can anyone tell me where I  
> need to make changes so that systemwide I’m using .4. httpd.conf?
> 
> I used Martin Dittus’ howto when setting up apache  
> [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

Also I have the newer ruby in /usr/bin and the older in /usr/local/lib  
if that helps  
M

---

<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, 12:47am UTC](https://www.ruby-forum.com/t/rhtml-cant-find-rubygems/99542/5 "2006-07-25T00:47:20Z")

</div>

On 7/24/06, Day, Chuck [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Please unsubscribe me.

Look in the email header:  
List-Unsubscribe: [mailto:removed\_email\_address@domain.invalid?body=unsubscribe](mailto:removed_email_address@domain.invalid?body=unsubscribe)

> Thank you.

You’re welcome.

---

<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, 12:43am UTC](https://www.ruby-forum.com/t/rhtml-cant-find-rubygems/99542/6 "2006-07-25T00:43:56Z")

</div>

Please unsubscribe me.

Thank you.  
Chuck

---

<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, 6:45am UTC](https://www.ruby-forum.com/t/rhtml-cant-find-rubygems/99542/7 "2006-07-25T06:45:43Z")

</div>

Please unsubscribe me.

Thanks

Tanushee Bhoi

---

<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, 2:53pm UTC](https://www.ruby-forum.com/t/rhtml-cant-find-rubygems/99542/8 "2006-07-25T14:53:10Z")

</div>

> Look in the email header:  
> List-Unsubscribe: \<[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)?  
> body=unsubscribe\>
