In Mustermann I use the common pattern of loading mustermann/version in the gemspec and then using that for the version:
VERSION ||= '0.0.1'
$:.unshift File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = "mustermann"
s.version = Mustermann::VERSION
Running a bundle install in 2.0 mode on the latest nightly build, I get this:
There was a NameError while loading mustermann.gemspec:
uninitialized constant Mustermann::VERSION from
Hmm, strange. We are still sharing RubyGems pre-2.0 across 1.9.3 and 2.0 modes, I believe, but I don't see how that could cause this.
I tried this with the thread_safe gem, which does a similar require to access version, and it seemed to work ok. I even changed it to modify $: like your example.
When you say latest nightly, do you mean our src archive or our bin? Those builds do not include 2.0 stdlib yet...so perhaps something's odd there? My master build of JRuby works ok...maybe you can test that.
I use this one: http://ci.jruby.org/snapshots/master/jruby-bin-1.7.4.dev.tar.gz
Will compile from source.
Figured this out. Ruby 1.8 defines a top-level constant VERSION, but 1.9.3 and 2.0 do not. Your VERSION ||= ... line does not define VERSION under Mustermann as a result.
Fix coming. Not sure where/whether to add a test for this, since RubySpec is not supposed to spec things that aren't there.
VERSION toplevel constant is not defined in 1.9 or 2.0. Fixes #665