Why am I getting a Namerror with the levelous source code on Mongrel?
I've downloaded the project from github and tried to run it on mongrel as is and I get this error:
Simpleton:levelous pawel$ ruby script/server => Booting Mongrel => Rails 2.3.5 application starting on http://0.0.0.0:3000 /Users/pawel/Ruby/levelous/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:119:in requirement': undefined local variable or method
version_requirements' for # (NameError)
from /Library/Ruby/Site/1.8/rubygems.rb:254:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:1204:in `gem'
from /Users/pawel/Ruby/levelous/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:73:in `add_load_paths'
from /Users/pawel/Ruby/levelous/config/../vendor/rails/railties/lib/initializer.rb:301:in `add_gem_load_paths'
from /Users/pawel/Ruby/levelous/config/../vendor/rails/railties/lib/initializer.rb:301:in `each'
from /Users/pawel/Ruby/levelous/config/../vendor/rails/railties/lib/initializer.rb:301:in `add_gem_load_paths'
from /Users/pawel/Ruby/levelous/config/../vendor/rails/railties/lib/initializer.rb:132:in `process'
from /Users/pawel/Ruby/levelous/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
from /Users/pawel/Ruby/levelous/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
from /Users/pawel/Ruby/levelous/config/environment.rb:9
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `require'
from /Users/pawel/Ruby/levelous/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
from /Users/pawel/Ruby/levelous/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/pawel/Ruby/levelous/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
from /Users/pawel/Ruby/levelous/vendor/rails/railties/lib/commands/server.rb:84
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `require'
from script/server:3
Simpleton:levelous pawel$
I am running Ruby 1.8.7 and Rails 2.3.5
try this in your config/environment.rb
after: require File.join(File.dirname( FILE ), 'boot')
if Gem::VERSION >= "1.3.6"
module Rails
class GemDependency
def requirement
r = super
(r == Gem::Requirement.default) ? nil : r
end
end
end
end
and before: Rails::Initializer.run do |config|
链接地址: http://www.djcxy.com/p/38754.html上一篇: 未初始化的常量ActiveSupport :: Dependencies :: Mutex(NameError)