1.9 bug?

R

Roger Pack

here's a function


def rubygems_version
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
end

1.8.6
irb(main):005:0* rubygems_version
=> "1.3.0"

1.9

irb(main):001:0> def rubygems_version
irb(main):002:1> Gem::RubyGemsVersion if defined?
Gem::RubyGemsVersion
irb(main):003:1> end
=> nil

hmm.


I guess it's because of the way that 1.9 'auto integrates' gems?

irb19=> "constant"

After this point the rubygems_version method works in 1.9


-=R
 
R

Roger Pack

Another 1.9 gems difference [?]

/Users/rogerpack/dev/ruby_19_installed/lib/ruby/gems/1.9.0/gems/rails-2.1.0/lib/rails/plugin/locator.rb:81:in
`map': private method `specification' called for
#<Rails::GemDependency:0x139ba24> (NoMethodError)

doesn't happen in 1.8
(both with gems v 1.3)

Thanks.
-=R
 
D

David Palm

I guess it's because of the way that 1.9 'auto integrates' gems?
irb19
=> "constant"

After this point the rubygems_version method works in 1.9


I've seen this too; it's especially annoying as it stops rails from booting out of the box.

The fix is easy though. In boot.rb, change:
unless rubygems_version >= '0.9.4'
into:
unless (rubygems_version || Gem::RubyGemsVersion) >= '0.9.4'

I'd be very interested in hearing the explanation for this weird behaviour!
 
E

Eric Hodel

here's a function


def rubygems_version
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
end

1.8.6
irb(main):005:0* rubygems_version
=> "1.3.0"

1.9

irb(main):001:0> def rubygems_version
irb(main):002:1> Gem::RubyGemsVersion if defined?
Gem::RubyGemsVersion
irb(main):003:1> end
=> nil

hmm.


I guess it's because of the way that 1.9 'auto integrates' gems?

irb19
=> "constant"

After this point the rubygems_version method works in 1.9

Something seems to be preventing defined?'s const_missing from being
handled properly. I'll look into it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top