Ruby on Rails / cannot remove Object::ClassMethods (NameError)

В случае возникновения этой (или похожей) ошибки с `remove_const': cannot remove Object::ClassMethods (NameError):

/home/user/.rvm/gems/ruby-1.8.7-p352@gemset/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:629:in `remove_const': cannot remove Object::ClassMethods (NameError)
from /home/user/.rvm/gems/ruby-1.8.7-p352@gemset/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:629:in `remove_constant'
from /home/user/.rvm/gems/ruby-1.8.7-p352@gemset/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:629:in `instance_eval'
from /home/user/.rvm/gems/ruby-1.8.7-p352@gemset/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:629:in `remove_constant'
from /home/user/.rvm/gems/ruby-1.8.7-p352@gemset/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:575:in `new_constants_in'
from /home/user/.rvm/gems/ruby-1.8.7-p352@gemset/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:575:in `each'
from /home/user/.rvm/gems/ruby-1.8.7-p352@gemset/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:575:in `new_constants_in'
from /home/user/.rvm/gems/ruby-1.8.7-p352@gemset/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
from /home/user/.rvm/gems/ruby-1.8.7-p352@gemset/gems/rails-2.3.14/lib/commands/server.rb:84
from script/server:3:in `require'
from script/server:3


Нужно найти файл [...]/activesupport-2.3.14/lib/active_support/dependencies.rb
И временно закомментировать несколько строк, чтоб получилось так:
def require(file, *extras) #:nodoc:
# if Dependencies.load?
# Dependencies.new_constants_in(Object) { super }
# else
super
# end
#rescue Exception => exception # errors from required file
# exception.blame_file! file
# raise
end

No comments:

Post a Comment