[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Strange Camping Error

Tony Cosentini

2/15/2007 1:40:00 AM

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

--
Posted via http://www.ruby-....

8 Answers

Chris Carter

2/15/2007 2:08:00 AM

0

On 2/14/07, Tony Cosentini <starnix17@gmail.com> wrote:
> 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
>
> --
> Posted via http://www.ruby-....
>
>
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.

--
Chris Carter
concentrationstudios.com
brynmawrcs.com

Tony Cosentini

2/15/2007 3:04:00 AM

0

Chris Carter wrote:
> On 2/14/07, Tony Cosentini <starnix17@gmail.com> wrote:
>> load.
>>
>> Anyone have any ideas as to why my application can't load Camping?
>> Thanks
>>
>> --
>> Posted via http://www.ruby-....
>>
>>
> 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] )

--
Posted via http://www.ruby-....

Harold Hausman

2/15/2007 3:12:00 AM

0

On 2/15/07, Tony Cosentini <starnix17@gmail.com> wrote:
>
> 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

Jeremy McAnally

2/15/2007 3:48:00 AM

0

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

--Jeremy

On 2/14/07, Tony Cosentini <starnix17@gmail.com> wrote:
> Chris Carter wrote:
> > On 2/14/07, Tony Cosentini <starnix17@gmail.com> wrote:
> >> load.
> >>
> >> Anyone have any ideas as to why my application can't load Camping?
> >> Thanks
> >>
> >> --
> >> Posted via http://www.ruby-....
> >>
> >>
> > 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] )
>
> --
> Posted via http://www.ruby-....
>
>


--
http://www.jeremymca...

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

My blogs:
http://www.mrneigh...
http://www.rubyinpra...

Tony Cosentini

2/15/2007 4:17:00 AM

0

Jeremy McAnally wrote:
> 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'.

--
Posted via http://www.ruby-....

Tony Cosentini

2/16/2007 1:37:00 AM

0

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?

--
Posted via http://www.ruby-....

Giles Bowkett

2/16/2007 3:54:00 PM

0

On 2/15/07, Tony Cosentini <starnix17@gmail.com> wrote:
> 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?

--
Giles Bowkett
http://www.gilesg...
http://gilesbowkett.bl...
http://gilesgoatboy.bl...

Tony Cosentini

2/17/2007 3:10:00 AM

0

Giles Bowkett wrote:
> 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

--
Posted via http://www.ruby-....