# Rubygems-update 1.3.0 causing rake task problems?

**URL:** <https://www.ruby-forum.com/t/rubygems-update-1-3-0-causing-rake-task-problems/152009>\
**Category:** Rails\
**Created:** [October 28, 2008, 10:51pm UTC](https://www.ruby-forum.com/t/rubygems-update-1-3-0-causing-rake-task-problems/152009 "2008-10-28T22:51:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunaclaire](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/f4b2a3/32.png) [@lunaclaire](https://www.ruby-forum.com/u/lunaclaire)\
**Post date:** [October 28, 2008, 10:51pm UTC](https://www.ruby-forum.com/t/rubygems-update-1-3-0-causing-rake-task-problems/152009/1 "2008-10-28T22:51:55Z")

</div>

I’m running into problems with some of my rake tasks and I think it’s  
since my host updated rubygems to v 1.3.0.

Has anybody else seen this message?

Gem::SourceIndex#search support for String patterns is deprecated

./script/…/config/boot.rb:26 is outdated

that line of code is as follows:

rails\_gem = Gem.cache.search(‘rails’, “~\>#{version}.0”).sort\_by { |  
g| g.version.version }.last

I doint think it’s affecting my main app code… only the rake tasks.

Any ideas on what happended? Or how to fix this?

---

<div class="post-metadata">

**Author:** ![lunaclaire](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/f4b2a3/32.png) [@lunaclaire](https://www.ruby-forum.com/u/lunaclaire)\
**Post date:** [October 30, 2008, 4:36pm UTC](https://www.ruby-forum.com/t/rubygems-update-1-3-0-causing-rake-task-problems/152009/2 "2008-10-30T16:36:31Z")

</div>

just replace the line with

rails\_gem = Gem.cache.search(Gem::Dependency.new(‘rails’,  
“~\>#{version}.0”)).sort\_by { |g| g.version.version }.last

Note that the two string parameters to search() are wrapped in a  
Gem::Dependency object. Strange refactoring, took me quite a while.

HTH, Thomas

lunaclaire wrote:

> I’m running into problems with some of my rake tasks and I think it’s  
> since my host updated rubygems to v 1.3.0.
> 
> Has anybody else seen this message?
> 
> Gem::SourceIndex#search support for String patterns is deprecated
> 
> ./script/…/config/boot.rb:26 is outdated
> 
> that line of code is as follows:
> 
> rails\_gem = Gem.cache.search(‘rails’, “~\>#{version}.0”).sort\_by { |  
> g| g.version.version }.last
> 
> I doint think it’s affecting my main app code… only the rake tasks.
> 
> Any ideas on what happended? Or how to fix this?

---

<div class="post-metadata">

**Author:** ![lunaclaire](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/f4b2a3/32.png) [@lunaclaire](https://www.ruby-forum.com/u/lunaclaire)\
**Post date:** [October 30, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/rubygems-update-1-3-0-causing-rake-task-problems/152009/3 "2008-10-30T17:15:55Z")

</div>

just replace the line in boot.rb with

rails\_gem = Gem.cache.search(Gem::Dependency.new(‘rails’,  
“~\>#{version}.0”)).sort\_by { |g| g.version.version }.last

Note that the two string parameters to search() are replaced by one  
parameter of type Gem::Dependency. Think of it as wrapping the strings  
in the dependency object. Strange deprecation, took me quite some  
time.

HTH, Thomas
