Forum: Ruby Strange Camping Error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Tony C. (Guest)
on 2007-02-15 03:40
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
Chris C. (Guest)
on 2007-02-15 04:09
(Received via mailing list)
On 2/14/07, Tony C. <removed_email_address@domain.invalid> wrote:
> load.
>
> Anyone have any ideas as to why my application can't load Camping?
> Thanks
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
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.
Tony C. (Guest)
on 2007-02-15 05:03
Chris C. wrote:
> On 2/14/07, Tony C. <removed_email_address@domain.invalid> wrote:
>> load.
>>
>> Anyone have any ideas as to why my application can't load Camping?
>> Thanks
>>
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>>
> 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] )
Harold H. (Guest)
on 2007-02-15 05:12
(Received via mailing list)
On 2/15/07, Tony C. <removed_email_address@domain.invalid> 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 (Guest)
on 2007-02-15 05:49
(Received via mailing list)
Are you doing a require or require_gem (or properly, gem)?

--Jeremy

On 2/14/07, Tony C. <removed_email_address@domain.invalid> wrote:
> >>
> [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-forum.com/.
>
>


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

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

My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/
Tony C. (Guest)
on 2007-02-15 06:16
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'.
Tony C. (Guest)
on 2007-02-16 03:36
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?
Giles B. (Guest)
on 2007-02-16 17:54
(Received via mailing list)
On 2/15/07, Tony C. <removed_email_address@domain.invalid> 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?
Tony C. (Guest)
on 2007-02-17 05:10
Giles B. 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
This topic is locked and can not be replied to.