carlhuda/bundler — Issue #1633: Loading of gemspec/version.rb interferes with autoloading mechanisms.
Author: JustinLove
Created: 2012-01-19 18:37:46+00:00
State: open

The standard rubygem setup has a lib/my_gem/version.rb which defines

module MyGem
VERSION = "0.0.1"
end

This file is loaded in the .gemspec When the gem is referenced by a `path`, Bundler loads the gemspec, which causes `MyGem` to become defined. Libraries or frameworks (Rails, Guard) which use `const_missing` or other forms of reflection to load or optimize loading will then not trigger loading of the main module because the constant is already defined.

Minimal test case:

https://github.com/JustinLove/bundler_version_autoload_test_case