# Strange Camping Error

**URL:** <https://www.ruby-forum.com/t/strange-camping-error/85633>\
**Category:** Ruby\
**Created:** [February 15, 2007, 2:40am UTC](https://www.ruby-forum.com/t/strange-camping-error/85633 "2007-02-15T02:40:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![starnix17](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@starnix17](https://www.ruby-forum.com/u/starnix17)\
**Post date:** [February 15, 2007, 2:40am UTC](https://www.ruby-forum.com/t/strange-camping-error/85633/1 "2007-02-15T02:40:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![starnix17](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@starnix17](https://www.ruby-forum.com/u/starnix17)\
**Post date:** [February 15, 2007, 4:03am UTC](https://www.ruby-forum.com/t/strange-camping-error/85633/2 "2007-02-15T04:03:48Z")

</div>

Chris C. wrote:

> On 2/14/07, Tony C. [removed\_email\_address@domain.invalid](mailto: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/](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] )

---

<div class="post-metadata">

**Author:** ![starnix17](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@starnix17](https://www.ruby-forum.com/u/starnix17)\
**Post date:** [February 15, 2007, 3:09am UTC](https://www.ruby-forum.com/t/strange-camping-error/85633/3 "2007-02-15T03:09:10Z")

</div>

On 2/14/07, Tony C. [removed\_email\_address@domain.invalid](mailto: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/](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.

---

<div class="post-metadata">

**Author:** ![starnix17](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@starnix17](https://www.ruby-forum.com/u/starnix17)\
**Post date:** [February 15, 2007, 4:12am UTC](https://www.ruby-forum.com/t/strange-camping-error/85633/4 "2007-02-15T04:12:15Z")

</div>

On 2/15/07, Tony C. [removed\_email\_address@domain.invalid](mailto: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

---

<div class="post-metadata">

**Author:** ![starnix17](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@starnix17](https://www.ruby-forum.com/u/starnix17)\
**Post date:** [February 15, 2007, 4:49am UTC](https://www.ruby-forum.com/t/strange-camping-error/85633/5 "2007-02-15T04:49:18Z")

</div>

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

–Jeremy

On 2/14/07, Tony C. [removed\_email\_address@domain.invalid](mailto: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.ruby-forum.com/).

–  
[http://www.jeremymcanally.com/](http://www.jeremymcanally.com/)

My free Ruby e-book:  
[http://www.humblelittlerubybook.com/book/](http://www.humblelittlerubybook.com/book/)

My blogs:

> **[Site not found · DreamHost](http://www.mrneighborly.com/)**
>
> The owner of this domain has not yet uploaded their website.

[http://www.rubyinpractice.com/](http://www.rubyinpractice.com/)

---

<div class="post-metadata">

**Author:** ![starnix17](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@starnix17](https://www.ruby-forum.com/u/starnix17)\
**Post date:** [February 15, 2007, 5:16am UTC](https://www.ruby-forum.com/t/strange-camping-error/85633/6 "2007-02-15T05:16:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![starnix17](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@starnix17](https://www.ruby-forum.com/u/starnix17)\
**Post date:** [February 16, 2007, 4:54pm UTC](https://www.ruby-forum.com/t/strange-camping-error/85633/7 "2007-02-16T16:54:24Z")

</div>

On 2/15/07, Tony C. [removed\_email\_address@domain.invalid](mailto: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?

---

<div class="post-metadata">

**Author:** ![starnix17](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@starnix17](https://www.ruby-forum.com/u/starnix17)\
**Post date:** [February 16, 2007, 2:36am UTC](https://www.ruby-forum.com/t/strange-camping-error/85633/8 "2007-02-16T02:36:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![starnix17](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@starnix17](https://www.ruby-forum.com/u/starnix17)\
**Post date:** [February 17, 2007, 4:10am UTC](https://www.ruby-forum.com/t/strange-camping-error/85633/9 "2007-02-17T04:10:14Z")

</div>

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
