Skip to content

Instantly share code, notes, and snippets.

@whizcreed
Created August 4, 2011 19:27
Show Gist options
  • Save whizcreed/1126006 to your computer and use it in GitHub Desktop.
Save whizcreed/1126006 to your computer and use it in GitHub Desktop.
Fixing "undefined local variable or method `version_requirements' for #<Rails::GemDependency:0x...> (NameError)"
# Phillip Koebbe from Ruby on Rails suggested inserting following code between the "bootstrap" and "initialize" sections of enviroment.rb. This hack fixes the problem.
# Ref: http://www.redmine.org/issues/7516#note-3
# Useful with community engine as well.
if Gem::VERSION >= "1.3.6"
module Rails
class GemDependency
def requirement
r = super
(r == Gem::Requirement.default) ? nil : r
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment