buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Assaf Arkin" <ar...@intalio.com>
Subject Re: rake setup runs forever
Date Wed, 30 Jul 2008 19:10:12 GMT
On Wed, Jul 30, 2008 at 11:44 AM, Geoff Ruscoe
<gcruscoe@sigmavisions.com> wrote:
> Okay thank you much, that was what I needed to get started:
>
> After messing with the gems some more I get passed an infinite loop trying
> to load fastthreads.  Seems like a bug also but is out of scope.
>
> Now when I try to build I am getting the following error (with --debug and
> --trace)
>
> Exception `NoMethodError' at
> /usr/lib/ruby/site_ruby/1.8/rubygems/version.rb:238 - undefined method
> `collect' for #<Gem::Version::Requirement:0xb7df96a4>
> rake aborted!
> undefined method `collect' for #<Gem::Version::Requirement:0xb7df96a4>
> /usr/lib/ruby/site_ruby/1.8/rubygems/version.rb:238:in `initialize'
> /usr/lib/ruby/site_ruby/1.8/rubygems/version.rb:29:in `new'
> /usr/lib/ruby/site_ruby/1.8/rubygems/version.rb:29:in `initialize'
> /home/gruscoe/work/buildr/rakelib/setup.rake:40:in `new'
> /home/gruscoe/work/buildr/rakelib/setup.rake:40:in `install_gem'
> /home/gruscoe/work/buildr/rakelib/setup.rake:58
> /home/gruscoe/work/buildr/rakelib/setup.rake:57:in `each'
> /home/gruscoe/work/buildr/rakelib/setup.rake:57
>
>
> I have tracked this down to line: 58(ish I may have added some puts before
> this):
>
> The code block is:
> desc "If you're building from sources, run this task one to setup the
> necessary dependencies."
> missing = spec.dependencies.select { |dep|
> Gem::SourceIndex.from_installed_gems.search(dep).empty? }
> task 'setup' do
>   missing.each do |dep|
>     install_gem dep.name, dep.version_requirements
>   end
> end
> puts "Missing Gems #{missing.join(', ')}, please run rake setup first!"
> unless missing.empty?
>
>
> Now the dep.version_requirements is actually Version::Requirement (which
> doesn't have the collect method).
>
> The code that is failing because of this call is:
>
>
> /usr/lib/ruby/site_ruby/1.8/rubygems/version.rb (around 238)
>     def initialize(reqs)
>       puts("reqs is: #{reqs.class}")
>       @requirements = reqs.collect do |rq|
>         op, version_string = parse(rq)
>         [op, Version.new(version_string)]
>       end
>       @version = nil   # Avoid warnings.
>     end
>
> As you can see I added the puts to see what classes are normally passed in.
> They are always Array or String (although the doc mentions Array of
> String).  So it appears that the setup needs to be passing in something
> slightly differently then the dep.version_requirements.
>
> I would guess most people already have their ruby deps done so they do not
> have this problem.  I also do not have a fix for it.  I really only needed
> to build so I could test the documentation I was sending so, hopefully this
> will somehow get fixed before I need it again.
>
> If there's anything else I can do please let me know.

That's just as much information as I needed.

I'm using RubyGems 1.2 which has some API changes, and I can't use
both versions side by side to see how they differ.  1.2's Dependency
takes the requirement argument and converts it into a requirements
array, so it doesn't mind that we're passing a string.  Judging by
what you found out, it's one of those API changes they warned us
about.

So as a quick fix, can you change line 40 in setup.rake to this:
  dep = Gem::Dependency.new(name, Array(ver_requirement))

If that works I'll commit it to SVN.


I actually expect rake setup to work for everyone.  It's an open
source project, I think it's critical that you can use it from source
as easily as installing a gem.

On the other hand, there are some nice things about RubyGems 1.2, at
some point rake setup will start depending on it.

Assaf

>
>
>
>
> On Tue, Jul 29, 2008 at 8:55 PM, Assaf Arkin <arkin@intalio.com> wrote:
>>
>> On Tue, Jul 29, 2008 at 7:36 AM, Geoff Ruscoe <gcruscoe@sigmavisions.com>
>> wrote:
>> > I am trying to run rake setup on what I just checked out of svn.
>> >
>> > I run rake setup and it runs forever using 100% cpu.
>> >
>> > $ rake setup install
>> > (in /......./work/buildr)
>> >
>> > And there it sits for as long as I let it.
>> >
>> > I have buildr installed as a gem also (and for jruby, but I have removed
>> > jruby from my path).
>> >
>> > Any ideas?
>>
>> Can you try:
>>  ruby --debug -S rake setup
>>
>> That will spit out error messages on the console, to try and see how
>> far it goes before it gets stuck.  If not, a few puts statements.
>>
>> Assaf
>
>
>
> --
> Geoff Ruscoe
> Sigma Visions Computer Consulting
>

Mime
View raw message