Rails 2.3.5启动:remove_const无法删除Object :: NotSupported(NameError)

时间:2010-12-14 21:53:27

标签: ruby-on-rails rubygems

我假设我在宝石依赖地狱这里,但如果有人可以帮助我会非常感激(谷歌搜索“无法删除Object :: NotSupported”字面上返回零结果)。

我有一个Rails 2.3.5应用程序,我在初始化时获得了这个堆栈跟踪:

usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:603:in `remove_const': cannot remove Object::NotSupported (NameError)
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:603:in `remove_constant'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:603:in `instance_eval'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:603:in `remove_constant'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:549:in `new_constants_in'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:549:in `each'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:549:in `new_constants_in'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:622:in `load_application_initializers'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:621:in `each'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:621:in `load_application_initializers'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:176:in `process'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
    from /data/groupsale/releases/20101214214330/config/environment.rb:9
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:84
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from script/server:3

我已经浏览了每个config.gem行,然后开始删除初始化程序,直到此错误消失,我开始看到“真正的”错误(关于我删除的内容)但我无法查明违规的。有没有人有(a)关于更好地解决这个问题的任何建议,或者(b)Object :: NotSupported发出任何响铃......它几乎看起来很可疑。

谢谢, 汤姆

P.S。宝石列表如下:

aaronh-chronic (0.3.9)
abstract (1.0.0)
actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (3.0.1, 2.3.5)
aws (2.3.26)
aws-s3 (0.6.2)
barby (0.4.2)
bitly (0.5.3)
bson (1.1.4)
bson_ext (1.1.4)
builder (2.1.2)
crack (0.1.8)
devise (1.0.9)
erubis (2.6.2)
eventmachine (0.12.6)
exceptional (2.0.26)
extlib (0.9.9)
eyrubygems (0.0.2)
facebooker (1.0.75)
facter (1.5.2)
fastercsv (1.5.3)
fastthread (1.0.7)
ferret (0.11.6)
forgery (0.3.4)
formtastic (0.9.7)
hoe (2.8.0)
hominid (2.1.0)
http_connection (1.4.0)
httparty (0.6.1)
i18n (0.5.0)
igrigorik-em-http-request (0.1.5)
jnunemaker-validatable (1.8.4)
json (1.1.3)
json_pure (1.4.6)
mime-types (1.16)
mini_magick (2.3)
money (3.1.5)
mongo (1.1.4)
mongo_ext (0.19.3)
mongo_mapper (0.8.6)
navvy (0.3.1)
ohai (0.2.0)
open4 (0.9.6)
paginator (1.1.1)
passenger (2.2.8)
plucky (0.3.6)
rack (1.0.1)
rails (2.3.5)
rails-footnotes (3.6.7)
rake (0.8.7)
RedCloth (4.2.3)
rest-client (0.9.2)
right_aws (1.10.0)
right_http_connection (1.2.4)
rmagick (2.12.2)
ruby-hmac (0.4.0)
ruby-openid (2.1.2)
rubyforge (2.0.4)
rubygems-update (1.3.6)
sparklines (0.5.2)
stomp (1.0.6)
subexec (0.0.4)
uuidtools (2.1.1)
warden (1.0.2)
whenever (0.6.2)
xml-simple (1.0.12)
yui-compressor (0.9.1)
zendesk_remote_auth (0.9.0)

2 个答案:

答案 0 :(得分:1)

所以,我发现调试这个最简单的方法是破解/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb并添加一行来记录它是什么东西加载。这样我就能隔离坏的初始化器。

此问题的根本原因是在初始化程序中,它尝试YAML ::加载计算机上不存在的配置文件。

答案 1 :(得分:0)

尝试从gemfile中删除erubis。

我收到同样的错误"错误NameError:无法删除Object :: KEY"与Erubis 2.6.5

没有那个宝石,我在视图中出现错误,我有一个明显的错误,堆栈跟踪弹出

希望这会有所帮助。