Forum: IronRuby require 'rubygems' gives llformed requirement [">= 0"] (ArgumentError)

6a9d4262d90fc5214f3ca62ebc7f1955?d=identicon&s=25 Martin Mazur (Guest)
on 2011-06-05 19:04
(Received via mailing list)
Hello,

When I try to require 'rubygems' in IronRuby on mono (OSX) I get the
following error

mono ir.exe -e "require 'rubygems'"

/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/requirement.rb:72:in
`parse': Illformed requirement [">= 0"] (ArgumentError)
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/requirement.rb:97:in
`map!'
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/requirement.rb:97:in
`initialize'
  from mscorlib:0:in `invoke_object__this___Func`4<object, Proc, object,
object>_object_Proc_object'
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/requirement.rb:97:in
`initialize'
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/requirement.rb:53:in
`default'
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/specification.rb:1201:in
`require'
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/specification.rb:1201
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/custom_require.rb:29:in
`require'
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/source_index.rb:8:in
`require'
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/source_index.rb:8
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/custom_require.rb:29:in
`require'
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems.rb:1088:in
`require'
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems.rb:1088
  from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/custom_require.rb:29:in
`require'

I've tried this with the IronRuby that ships with mono 2.10 binaries for
OSX and I've also built IronRuby v1.1.2 and v1.1.3 from source. I get
the same error in all three versions. Has anyone else experience this
and knows what the issue might be?

//M

--
phone: +46 (0)709 78 40 03
e-mail: m.m@upplopp.se
twitter: http://twitter.com/m_mazur
68f1bd9e9a7d9d10f0278c6535f700fe?d=identicon&s=25 Michael Letterle (mletterle)
on 2011-06-11 05:49
(Received via mailing list)
This appears to be a result of the following mono bug:
https://bugzilla.novell.com/show_bug.cgi?id=541823

The specific issue is that the regex:
(?-six:\A[\s]*(=|!=|>|<|>=|<=|~>)?[\s]*([0-9]+(\.[0-9a-zA-Z]+)*)[\s]*\z)
Does not match ">= 0" in mono but does match on .NET

This is a mono bug, not an ironruby bug.

On Sun, Jun 5, 2011 at 12:45 PM, Martin Mazur <m.m@upplopp.se> wrote:
>    from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/requirement.rb:97:in
`initialize'
>
> Ironruby-core mailing list
> Ironruby-core@rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>



--
Michael Letterle
----------//-----------
http://blog.prokrams.com
68f1bd9e9a7d9d10f0278c6535f700fe?d=identicon&s=25 Michael Letterle (mletterle)
on 2011-06-11 06:14
(Received via mailing list)
FWIW, the issue only appears to manifest itself when later sequences
in a '|' group are substrings of earlier squences.  So, for instance
if you move |>|< to the end of the group it appears to work:
(?-six:\A[\s]*(=|!=|>=|<=|~>|>|<)?[\s]*([0-9]+(\.[0-9a-zA-Z]+)*)[\s]*\z)

Editing the rubygems/requirement.rb file as follows allows rubygems to
load:

diff --git a/Languages/Ruby/StdLib/ruby/1.9.1/rubygems/requirement.rb
b/Languages/Ruby/StdLib/ruby/1.9.1/rubygems/requirement.
index d51bf8f..b47859e 100644
--- a/Languages/Ruby/StdLib/ruby/1.9.1/rubygems/requirement.rb
+++ b/Languages/Ruby/StdLib/ruby/1.9.1/rubygems/requirement.rb
@@ -10,10 +10,10 @@ class Gem::Requirement
   OPS = { #:nodoc:
     "="  =>  lambda { |v, r| v == r },
     "!=" =>  lambda { |v, r| v != r },
-    ">"  =>  lambda { |v, r| v > r  },
-    "<"  =>  lambda { |v, r| v < r  },
     ">=" =>  lambda { |v, r| v >= r },
     "<=" =>  lambda { |v, r| v <= r },
+    ">"  =>  lambda { |v, r| v > r  },
+    "<"  =>  lambda { |v, r| v < r  },
     "~>" =>  lambda { |v, r| v = v.release; v >= r && v < r.bump }
   }


No promises on the issue not creeping up down the road though...

On Fri, Jun 10, 2011 at 11:48 PM, Michael Letterle
<michael.letterle@gmail.com> wrote:
>> Hello,
>>    from
/Library/Frameworks/Mono.framework/Versions/2.10.1/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/requirement.rb:53:in
`default'
>> I've tried this with the IronRuby that ships with mono 2.10 binaries for OSX
and I've also built IronRuby v1.1.2 and v1.1.3 from source. I get the same error
in all three versions. Has anyone else experience this and knows what the issue
might be?
>> Ironruby-core@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/ironruby-core
>>
>
>
>
> --
> Michael Letterle
> ----------//-----------
> http://blog.prokrams.com
>



--
Michael Letterle
----------//-----------
http://blog.prokrams.com
6a9d4262d90fc5214f3ca62ebc7f1955?d=identicon&s=25 Martin Mazur (Guest)
on 2011-06-13 21:44
(Received via mailing list)
> This appears to be a result of the following mono bug:
> https://bugzilla.novell.com/show_bug.cgi?id=541823

Thank you! This helps me a lot.

//M
This topic is locked and can not be replied to.