# Require rubygems fails

**URL:** <https://www.ruby-forum.com/t/require-rubygems-fails/129237>\
**Category:** Rails\
**Created:** [February 15, 2008, 5:56pm UTC](https://www.ruby-forum.com/t/require-rubygems-fails/129237 "2008-02-15T17:56:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonaylward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Post date:** [February 15, 2008, 5:56pm UTC](https://www.ruby-forum.com/t/require-rubygems-fails/129237/1 "2008-02-15T17:56:47Z")

</div>

All of a sudden one of my applications at Dreamhost has stopped working  
Support there says they don’t support “3rd party applications”.

I suspect they’ve done some upgrade and its zapped things but they’re  
not handing out details.  
This is the error I get.  
Suggestions as the the most straight-forward way to address it?  
Remember, I’m at a hosted site so I don’t have control over /usr/bin or  
/usr/lib/ruby

$ ./dispatch.fcgi  
./…/config/boot.rb:18:in `require’: no such file to load – rubygems  
(LoadError)  
from ./…/config/boot.rb:18  
from ./…/config/environment.rb:8  
from ./dispatch.fcgi:21

Thanks

–  
Echelon appears to work very much like a Web search engine, except that  
instead of searching Web pages it searches through the world’s phone and  
data network traffic in real time.  
– Ross Anderson, _Security Engineering_

---

<div class="post-metadata">

**Author:** ![antonaylward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Post date:** [February 15, 2008, 6:27pm UTC](https://www.ruby-forum.com/t/require-rubygems-fails/129237/2 "2008-02-15T18:27:22Z")

</div>

Check if you can require rubygems ‘normally’  
irb  
require ‘rubygems’

if that doesn’t work then support should hear about it.  
If it does, then you may need to try to setup your rails app from  
scratch again (check for any directory settings, etc.).  
Gl.  
-roger

Anton A. wrote:

> All of a sudden one of my applications at Dreamhost has stopped working  
> Support there says they don’t support “3rd party applications”.
> 
> I suspect they’ve done some upgrade and its zapped things but they’re  
> not handing out details.  
> This is the error I get.  
> Suggestions as the the most straight-forward way to address it?  
> Remember, I’m at a hosted site so I don’t have control over /usr/bin or  
> /usr/lib/ruby
> 
> $ ./dispatch.fcgi  
> ./../config/boot.rb:18:in `require’: no such file to load – rubygems  
> (LoadError)  
> from ./../config/boot.rb:18  
> from ./../config/environment.rb:8  
> from ./dispatch.fcgi:21
> 
> Thanks
> 
> –  
> Echelon appears to work very much like a Web search engine, except that  
> instead of searching Web pages it searches through the world’s phone and  
> data network traffic in real time.  
> – Ross Anderson, _Security Engineering_

---

<div class="post-metadata">

**Author:** ![antonaylward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Post date:** [February 15, 2008, 8:10pm UTC](https://www.ruby-forum.com/t/require-rubygems-fails/129237/3 "2008-02-15T20:10:35Z")

</div>

Anton A. wrote:

> –  
> Echelon appears to work very much like a Web search engine, except that  
> instead of searching Web pages it searches through the world’s phone and  
> data network traffic in real time.  
> – Ross Anderson, _Security Engineering_

In addition to Roger’s suggestion, once you get it working, running:  
“rake rails:freeze:gems”  
should more properly safeguard you against server changes in the future

hth

ilan

---

<div class="post-metadata">

**Author:** ![antonaylward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Post date:** [February 15, 2008, 8:47pm UTC](https://www.ruby-forum.com/t/require-rubygems-fails/129237/4 "2008-02-15T20:47:47Z")

</div>

Ilan B. said the following on 15/02/08 02:10 PM:

> In addition to Roger’s suggestion, once you get it working, running:  
> “rake rails:freeze:gems”  
> should more properly safeguard you against server changes in the future

$ rake rails:freeze:gems  
/home/antonaylward/bin/rake:9:in `require’: no such file to load –  
rubygems (LoadError)  
from /home/antonaylward/bin/rake:9

Hmm.  
Reset PATH.  
Got

/home/.jordana/antonaylward/typo/config/boot.rb:38:Warning: require\_gem  
is obsolete. Use gem instead.

Fixed that.  
But I Still get

[ralphie]$ rake rails:freeze:gems  
/usr/bin/rake:17:Warning: require\_gem is obsolete. Use gem instead.

Does this mean that the system ‘rake’ is out of date?

The freeze seemed to settle on Rails-2.02  
I don’t think Typo likes that!

How would I freeze the gems to an earlier version?

After unfreezing the above I listed the gems to see which version of  
rails there were. Only 2.02 and 1.2.6, so I tried

[ralphie]$ rake rails:freeze:edge TAG=rel\_1.2.6

which now results in

./public/../config/boot.rb:16:in `require': no such file to load -- public/../config/../vendor/rails/railties/lib/initializer (LoadError) from ./public/../config/boot.rb:16 from ./public/../config/environment.rb:8:in `require’  
from ./public/../config/environment.rb:8  
from ./public/dispatch.fcgi:21:in `require’  
from ./public/dispatch.fcgi:21

–  
If you can’t beat your computer at chess, try kickboxing.

---

<div class="post-metadata">

**Author:** ![antonaylward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Post date:** [July 15, 2012, 5:00am UTC](https://www.ruby-forum.com/t/require-rubygems-fails/129237/5 "2012-07-15T05:00:18Z")

</div>

well，if you use the rvm to manage the ruby version,

you should modify them “dispatch.fcgi” “dispatch.cgi” “dispatch.rb”

change “#!/usr/bin/ruby” to “#!/usr/bin/env ruby”

---

<div class="post-metadata">

**Author:** ![antonaylward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Post date:** [July 15, 2012, 5:25am UTC](https://www.ruby-forum.com/t/require-rubygems-fails/129237/6 "2012-07-15T05:25:12Z")

</div>

I posted that message about 4.5 years ago.. way before rvm was even  
around.

star star wrote in post #1068786:

> well，if you use the rvm to manage the ruby version,
> 
> you should modify them “dispatch.fcgi” “dispatch.cgi” “dispatch.rb”
> 
> change “#!/usr/bin/ruby” to “#!/usr/bin/env ruby”
