Rubygems-update 1.3.0 causing rake task problems?

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?

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?

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs