gpt4 book ai didi

ruby-on-rails - Rails 2.3.10错误

转载 作者:行者123 更新时间:2023-12-04 06:19:10 24 4
gpt4 key购买 nike

我正在升级我的Rails 2.3.8应用程序,但出现了一个奇怪的错误。

/Users/davide/.rvm/gems/ruby-1.9.2-p0@rails2/gems/rails-2.3.10/lib/rails/vendor_gem_source_index.rb:76:in `block in refresh!': undefined method `[]' for nil:NilClass (NoMethodError)
from /Users/davide/.rvm/gems/ruby-1.9.2-p0@rails2/gems/rails-2.3.10/lib/rails/vendor_gem_source_index.rb:45:in `each'
from /Users/davide/.rvm/gems/ruby-1.9.2-p0@rails2/gems/rails-2.3.10/lib/rails/vendor_gem_source_index.rb:45:in `refresh!'
from /Users/davide/.rvm/gems/ruby-1.9.2-p0@rails2/gems/rails-2.3.10/lib/rails/vendor_gem_source_index.rb:29:in `initialize'
from /Users/davide/.rvm/gems/ruby-1.9.2-p0@rails2/gems/rails-2.3.10/lib/rails/gem_dependency.rb:21:in `new'
from /Users/davide/.rvm/gems/ruby-1.9.2-p0@rails2/gems/rails-2.3.10/lib/rails/gem_dependency.rb:21:in `add_frozen_gem_path'
from /Users/davide/.rvm/gems/ruby-1.9.2-p0@rails2/gems/rails-2.3.10/lib/initializer.rb:298:in `add_gem_load_paths'
from /Users/davide/.rvm/gems/ruby-1.9.2-p0@rails2/gems/rails-2.3.10/lib/initializer.rb:132:in `process'
from /Users/davide/.rvm/gems/ruby-1.9.2-p0@rails2/gems/rails-2.3.10/lib/initializer.rb:113:in `run'
from /Users/davide/Code/giardinilucrezia/config/environment.rb:12:in `<top (required)>'
from /Users/davide/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:281:in `require'
from /Users/davide/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:281:in `block in load_modules'
from /Users/davide/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:279:in `each'
from /Users/davide/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:279:in `load_modules'
from /Users/davide/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:20:in `setup'
from /Users/davide/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb.rb:53:in `start'
from /Users/davide/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'


Rails 2.3.8根本没有问题。
和堆栈跟踪不能帮助我。
任何想法?

我正在使用ruby 1.9.2,rails 2.3.10和bundler。

谢谢

最佳答案

我看起来this rails bug是相关的。简而言之,就是cvs和svn目录存在问题。
要安装猴子补丁,请将其添加到config / preinitializer.rb

gem 'rails'
require 'initializer'

module Rails
class VendorGemSourceIndex

def version_for_dir(d)
version = d.split('-').find { |s| s.match(/^\d(\.\d|\.\w+)*$/) }
Gem::Version.new(version) if version
end

end
end

关于ruby-on-rails - Rails 2.3.10错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4126520/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com