Rhtml can't find rubygems

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
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
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

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?

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/

best
Max

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

best
Max

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

On 7/24/06, Day, Chuck [email protected] wrote:

Please unsubscribe me.

Look in the email header:
List-Unsubscribe: mailto:[email protected]?body=unsubscribe

Thank you.

You’re welcome.

Please unsubscribe me.

Thank you.
Chuck

Please unsubscribe me.

Thanks

Tanushee Bhoi

Look in the email header:
List-Unsubscribe: <mailto:[email protected]?
body=unsubscribe>