# Rails/Gem errors?

**URL:** <https://www.ruby-forum.com/t/rails-gem-errors/82315>\
**Category:** Rails\
**Created:** [January 19, 2007, 11:52am UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315 "2007-01-19T11:52:32Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 19, 2007, 11:52am UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/1 "2007-01-19T11:52:32Z")

</div>

Is anyone else getting annoying warning messages?

/usr/local/bin/rails:17:Warning: require\_gem is obsolete. Use gem  
instead.

I get these messages when using the rails command, rake, script/generate  
etc etc.

I’m using Rails 1.2.1

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 19, 2007, 11:56am UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/2 "2007-01-19T11:56:02Z")

</div>

David W. wrote:

> Is anyone else getting annoying warning messages?
> 
> /usr/local/bin/rails:17:Warning: require\_gem is obsolete. Use gem  
> instead.
> 
> I get these messages when using the rails command, rake, script/generate  
> etc etc.
> 
> I’m using Rails 1.2.1

You can fix it in environment.rb. Find the ‘require\_gem’ lines and  
replace them with ‘gem’

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 19, 2007, 12:28pm UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/3 "2007-01-19T12:28:52Z")

</div>

David W. wrote:

> Is anyone else getting annoying warning messages?
> 
> /usr/local/bin/rails:17:Warning: require\_gem is obsolete. Use gem  
> instead.
> 
> I get these messages when using the rails command, rake, script/generate  
> etc etc.
> 
> I’m using Rails 1.2.1

This has more to do with the new rubygems than rails - new versions of  
everything seem to be coming out at once!

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 19, 2007, 4:54pm UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/4 "2007-01-19T16:54:10Z")

</div>

David W. wrote:

> Alan F. wrote:

> > You can fix it in environment.rb. Find the ‘require\_gem’ lines and  
> > replace them with ‘gem’
> 
> Actually, do:
> 
> ```
> gem pristine --all
> 
> ```
> 
> From: [http://comments.gmane.org/gmane.comp.lang.ruby.rails/117220](http://comments.gmane.org/gmane.comp.lang.ruby.rails/117220)

I don’t think that’ll work. I did it on my machine immediatly I upgraded  
gems, and _still_ had to fix my rails app.

I got the impression it only fixed the binstubs - ‘rails’, ‘rake’, ‘cap’  
etc I dont think it’ll search out uses of require\_gem in rb files on  
your machine ?

A.

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 19, 2007, 4:32pm UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/5 "2007-01-19T16:32:37Z")

</div>

Alan F. wrote:

> David W. wrote:
> 
> > Is anyone else getting annoying warning messages?
> > 
> > /usr/local/bin/rails:17:Warning: require\_gem is obsolete. Use gem  
> > instead.
> > 
> > I get these messages when using the rails command, rake, script/generate  
> > etc etc.
> > 
> > I’m using Rails 1.2.1
> 
> You can fix it in environment.rb. Find the ‘require\_gem’ lines and  
> replace them with ‘gem’

Actually, do:

```
gem pristine --all

```

From: [http://comments.gmane.org/gmane.comp.lang.ruby.rails/117220](http://comments.gmane.org/gmane.comp.lang.ruby.rails/117220)

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 19, 2007, 4:59pm UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/6 "2007-01-19T16:59:00Z")

</div>

Alan F. wrote:

> David W. wrote:
> 
> > Alan F. wrote:
> 
> > > You can fix it in environment.rb. Find the ‘require\_gem’ lines and  
> > > replace them with ‘gem’
> > 
> > Actually, do:
> > 
> > ```
> > gem pristine --all
> > 
> > ```
> > 
> > From: [http://comments.gmane.org/gmane.comp.lang.ruby.rails/117220](http://comments.gmane.org/gmane.comp.lang.ruby.rails/117220)
> 
> I don’t think that’ll work. I did it on my machine immediatly I upgraded  
> gems, and _still_ had to fix my rails app.
> 
> I got the impression it only fixed the binstubs - ‘rails’, ‘rake’, ‘cap’  
> etc I dont think it’ll search out uses of require\_gem in rb files on  
> your machine ?
> 
> A.

You’re right. The moment I saw it, I thought it was the ‘official’ fix.  
I was wrong. Doing a `rake db:migrate` produces the warning. Very  
irritating.

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 19, 2007, 5:09pm UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/7 "2007-01-19T17:09:40Z")

</div>

David W. wrote:

> Here’s the ticket for it:
> 
> [http://dev.rubyonrails.org/ticket/6886](http://dev.rubyonrails.org/ticket/6886)
> 
> I hope it’ll get fixed soon. It’s very off-putting seeing that warning  
> each time doing something.

You can fix it by editing your environment.rb as described earlier in  
the thread.

A.

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 19, 2007, 6:04pm UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/8 "2007-01-19T18:04:12Z")

</div>

Anonymous Coward wrote:

> David W. wrote:
> 
> > Here’s the ticket for it:
> > 
> > [http://dev.rubyonrails.org/ticket/6886](http://dev.rubyonrails.org/ticket/6886)
> > 
> > I hope it’ll get fixed soon. It’s very off-putting seeing that warning  
> > each time doing something.
> 
> You can fix it by editing your environment.rb as described earlier in  
> the thread.
> 
> A.

boot.rb contains the `require_gem` piece of code.

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 19, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/9 "2007-01-19T17:01:16Z")

</div>

Here’s the ticket for it:

[http://dev.rubyonrails.org/ticket/6886](http://dev.rubyonrails.org/ticket/6886)

I hope it’ll get fixed soon. It’s very off-putting seeing that warning  
each time doing something.

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 20, 2007, 5:28am UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/10 "2007-01-20T05:28:50Z")

</div>

On Fri, 2007-01-19 at 12:28 +0100, askegg wrote:

> This has more to do with the new rubygems than rails - new versions of  
> everything seem to be coming out at once!

* * *

ok, I updated to 0.9.1 and now…

# gem pristine --all

Restoring gem(s) to pristine condition…  
Rebuilt all bin stubs  
All installed gem files are already in pristine condition

# gem check

# gem update

Updating installed gems…  
ERROR: While executing gem … (NoMethodError)  
undefined method `refresh’ for #Hash:0xb7d212cc

ugh… anyone know how to fix this?

Craig

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 20, 2007, 6:34pm UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/11 "2007-01-20T18:34:57Z")

</div>

On Sat, 2007-01-20 at 10:24 +0100, David W. wrote:

> > Rebuilt all bin stubs
> 
> I’m pretty sure you want to do
> 
> ```
> sudo gem update
> 
> ```

* * *

been there and done that…

# gem update

Updating installed gems…  
ERROR: While executing gem … (NoMethodError)  
undefined method `refresh’ for #Hash:0xb7da43d4

this is the only type of gem command that will not toss that error…

# gem list

\*\*\* LOCAL GEMS \*\*\*

actionmailer (1.3.1, 1.2.5)  
Service layer for easy email delivery and testing.

actionpack (1.13.1, 1.12.5)  
Web-flow and rendering framework putting the VC in MVC.

actionwebservice (1.2.1, 1.1.6)  
Web service support for Action Pack.

activerecord (1.15.1, 1.14.4)  
Implements the ActiveRecord pattern for ORM.

activesupport (1.4.0, 1.3.1)  
Support and utility classes used by the Rails framework.

ajax\_scaffold\_generator (3.1.10)  
Ajax scaffold generator is a rails generator for ajaxified scaffolds

mysql (2.6)  
MySQL/Ruby provides the same functions for Ruby programs that the  
MySQL C API provides for C programs.

postgres (0.7.1)  
The extension library to access a PostgreSQL database from Ruby.

rails (1.2.1, 1.1.6)  
Web-application framework with template engine, control-flow layer,  
and ORM.

rake (0.7.1)  
Ruby based make-like utility.

rmagick (1.14.1, 1.13.0)  
RMagick is an interface between the Ruby programming language and  
the ImageMagick and GraphicsMagick image processing libraries.

sources (0.0.1)  
This package provides download sources for remote gem installation

Craig

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 20, 2007, 10:24am UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/12 "2007-01-20T10:24:57Z")

</div>

Craig W. wrote:

> On Fri, 2007-01-19 at 12:28 +0100, askegg wrote:
> 
> > This has more to do with the new rubygems than rails - new versions of  
> > everything seem to be coming out at once!
> 
> * * *
> 
> ok, I updated to 0.9.1 and now…
> 
> # gem pristine --all
> 
> Restoring gem(s) to pristine condition…  
> Rebuilt all bin stubs  
> All installed gem files are already in pristine condition
> 
> # gem check
> 
> # gem update
> 
> Updating installed gems…  
> ERROR: While executing gem … (NoMethodError)  
> undefined method `refresh’ for #Hash:0xb7d212cc
> 
> ugh… anyone know how to fix this?
> 
> Craig

I’m pretty sure you want to do

```
sudo gem update
```

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 21, 2007, 7:21am UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/13 "2007-01-21T07:21:22Z")

</div>

On Sat, 2007-01-20 at 10:24 +0100, David W. wrote:

> > Rebuilt all bin stubs
> 
> I’m pretty sure you want to do
> 
> ```
> sudo gem update
> 
> ```

* * *

I’m pretty sure that I am not alone with this problem since upgrading to  
gem 0.9.1

[https://rubyforge.org/tracker/index.php?func=detail&aid=7995&group\_id=126&atid=575](https://rubyforge.org/tracker/index.php?func=detail&aid=7995&group_id=126&atid=575)

Craig

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 27, 2007, 2:33pm UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/14 "2007-01-27T14:33:37Z")

</div>

Craig W. wrote:

> On Sat, 2007-01-20 at 10:24 +0100, David W. wrote:
> 
> > > Rebuilt all bin stubs
> > 
> > I’m pretty sure you want to do
> > 
> > ```
> > sudo gem update
> > 
> > ```
> 
> * * *
> 
> I’m pretty sure that I am not alone with this problem since upgrading to  
> gem 0.9.1
> 
> [https://rubyforge.org/tracker/index.php?func=detail&aid=7995&group\_id=126&atid=575](https://rubyforge.org/tracker/index.php?func=detail&aid=7995&group_id=126&atid=575)
> 
> Craig

Removing

/usr/local/lib/ruby/gems/1.8/source\_cache

solved the problem for me.

Guillermo

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [January 27, 2007, 6:45pm UTC](https://www.ruby-forum.com/t/rails-gem-errors/82315/15 "2007-01-27T18:45:20Z")

</div>

On Sat, 2007-01-27 at 14:33 +0100, Guillermo Marcus wrote:

> > [https://rubyforge.org/tracker/index.php?func=detail&aid=7995&group\_id=126&atid=575](https://rubyforge.org/tracker/index.php?func=detail&aid=7995&group_id=126&atid=575)
> > 
> > Craig
> 
> Removing
> 
> /usr/local/lib/ruby/gems/1.8/source\_cache
> 
> solved the problem for me.

* * *

yeah - it solved it for me too - thanks

Craig
