Forum: Ruby on Rails Rails/Gem errors?

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.
David W. (Guest)
on 2007-01-19 12:52
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
Alan F. (Guest)
on 2007-01-19 12:56
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'
askegg (Guest)
on 2007-01-19 13:28
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!
David W. (Guest)
on 2007-01-19 17:32
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
Alan F. (Guest)
on 2007-01-19 17:54
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

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.
David W. (Guest)
on 2007-01-19 17:59
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
>
> 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.
David W. (Guest)
on 2007-01-19 18:01
Here's the ticket for it:

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.
Anonymous Coward (Guest)
on 2007-01-19 18:09
David W. wrote:
> Here's the ticket for it:
>
> 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.
David W. (Guest)
on 2007-01-19 19:04
Anonymous Coward wrote:
> David W. wrote:
>> Here's the ticket for it:
>>
>> 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.
Craig W. (Guest)
on 2007-01-20 06:28
(Received via mailing list)
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
David W. (Guest)
on 2007-01-20 11:24
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
Craig W. (Guest)
on 2007-01-20 19:34
(Received via mailing list)
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
Craig W. (Guest)
on 2007-01-21 08:21
(Received via mailing list)
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=detai...

Craig
Guillermo Marcus (Guest)
on 2007-01-27 15:33
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=detai...
>
> Craig

Removing

/usr/local/lib/ruby/gems/1.8/source_cache

solved the problem for me.

Guillermo
Craig W. (Guest)
on 2007-01-27 19:45
(Received via mailing list)
On Sat, 2007-01-27 at 14:33 +0100, Guillermo Marcus wrote:
> >
> > https://rubyforge.org/tracker/index.php?func=detai...
> >
> > 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
This topic is locked and can not be replied to.