为什么我在Mongrel上使用平实的源代码获得Namerror?
我已经从github上下载了这个项目,并试图在杂种上运行它,我得到这个错误:
Simpleton:levelous pawel $ ruby script / server =>引导Mongrel => Rails 2.3.5应用程序从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)
从/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'
来自/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'
从脚本/服务器:3
Simpleton:水平的pawel $
我正在运行Ruby 1.8.7和Rails 2.3.5
在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
和之前:Rails :: Initializer.run do | config |
链接地址: http://www.djcxy.com/p/38753.html上一篇: Why am I getting a Namerror with the levelous source code on Mongrel?