Strange Camping Error

T

Tony Cosentini

I'm trying to deploy a simple Camping application using plain old CGI.
When I access the page I get a 500 error and in my logs it says:
[Wed Feb 14 17:18:46 2007] [error] [client 70.105.220.65] fortunes.cgi:
4:in `require': no such file to load -- camping (LoadError)

This makes it seem like Camping isn't installed, but if I do gem list
Camping is shown on the list. WIth that being said, I fired up IRB,
and entered require 'camping' which resulted in a "no such file to
load" error. After playing around with it a bit I noticed that if I
did require 'rubygems' and then require 'camping' the files would
load.

Anyone have any ideas as to why my application can't load Camping?
Thanks
 
C

Chris Carter

I'm trying to deploy a simple Camping application using plain old CGI.
When I access the page I get a 500 error and in my logs it says:
[Wed Feb 14 17:18:46 2007] [error] [client 70.105.220.65] fortunes.cgi:
4:in `require': no such file to load -- camping (LoadError)

This makes it seem like Camping isn't installed, but if I do gem list
Camping is shown on the list. WIth that being said, I fired up IRB,
and entered require 'camping' which resulted in a "no such file to
load" error. After playing around with it a bit I noticed that if I
did require 'rubygems' and then require 'camping' the files would
load.

Anyone have any ideas as to why my application can't load Camping?
Thanks
Hi Tony,
As you discovered in irb you must require 'rubygems' first, and you
need to do that in your script too. require 'rubygems' rewrites the
require method to search your gems too.
 
T

Tony Cosentini

Chris said:
Hi Tony,
As you discovered in irb you must require 'rubygems' first, and you
need to do that in your script too. require 'rubygems' rewrites the
require method to search your gems too.

Thanks for the explanation. I have require 'rubygems' before require
'camping' in my application, but I'm still getting an error:
[Wed Feb 14 18:58:48 2007] [error] [client 70.105.220.65] no such file
to load -- camping
[Wed Feb 14 18:58:48 2007] [error] [client 70.105.220.65] (
[Wed Feb 14 18:58:48 2007] [error] [client 70.105.220.65] LoadError
[Wed Feb 14 18:58:48 2007] [error] [client 70.105.220.65] )
 
H

Harold Hausman

Thanks for the explanation. I have require 'rubygems' before require
'camping' in my application, but I'm still getting an error:
[Wed Feb 14 18:58:48 2007] [error] [client 70.105.220.65] no such file
to load -- camping
[Wed Feb 14 18:58:48 2007] [error] [client 70.105.220.65] (
[Wed Feb 14 18:58:48 2007] [error] [client 70.105.220.65] LoadError
[Wed Feb 14 18:58:48 2007] [error] [client 70.105.220.65] )

Sometimes, these sorts of problems are created by the fact that the
webserver is actually running as a different user that doesn't have
access to the gems, etc... Depending on where/how the gems are
installed, and what user the webserver acts as, I've seen things like
this in the past.

Not a real solid answer, but maybe something to go on.

hth,
-Harold
 
J

Jeremy McAnally

Are you doing a require or require_gem (or properly, gem)?

--Jeremy

Chris said:
Hi Tony,
As you discovered in irb you must require 'rubygems' first, and you
need to do that in your script too. require 'rubygems' rewrites the
require method to search your gems too.

Thanks for the explanation. I have require 'rubygems' before require
'camping' in my application, but I'm still getting an error:
[Wed Feb 14 18:58:48 2007] [error] [client 70.105.220.65] no such file
to load -- camping
[Wed Feb 14 18:58:48 2007] [error] [client 70.105.220.65] (
[Wed Feb 14 18:58:48 2007] [error] [client 70.105.220.65] LoadError
[Wed Feb 14 18:58:48 2007] [error] [client 70.105.220.65] )


--
http://www.jeremymcanally.com/

My free Ruby e-book:
http://www.humblelittlerubybook.com/book/

My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/
 
T

Tony Cosentini

Jeremy said:
Are you doing a require or require_gem (or properly, gem)?

--Jeremy

I'm doing require.

First I have require 'rubygems', and on the next line is require
'camping'.
 
T

Tony Cosentini

Alright here's an update.
I was able to get iRB to find the Camping gem. I can also run the
Camping application in a shell and it runs fine. However, Apache is
still giving me the same strange error saying it's can't find Camping.
Anyone have any suggestions?
 
G

Giles Bowkett

Alright here's an update.
I was able to get iRB to find the Camping gem. I can also run the
Camping application in a shell and it runs fine. However, Apache is
still giving me the same strange error saying it's can't find Camping.
Anyone have any suggestions?

Do you know if Apache's definitely using the same Ruby? Does the
Apache user have permissions for the gems directory? How did you get
irb to find the gem so you can run it in the shell?
 
T

Tony Cosentini

Giles said:
Do you know if Apache's definitely using the same Ruby? Does the
Apache user have permissions for the gems directory? How did you get
irb to find the gem so you can run it in the shell?

I'm 100% that Apache is using the same Ruby, and the Apache user is the
same user that I was using in the shell, so it should have access to the
gems. I can load other gems with the CGI script (I.E. rails,
activerecord, etc.), but camping does not want to load. I tried
reinstalling the gems multiple times, and it still doesn't work. As for
irb, I simply ran require 'rubygems' and then require 'camping' and it
worked flawlessly.

Thanks for the suggestions,
Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,797
Messages
2,569,647
Members
45,377
Latest member
Zebacus

Latest Threads

Top