gpt4 book ai didi

ruby-on-rails - 没有要加载的文件 -- active_support/core_ext (LoadError)

转载 作者:行者123 更新时间:2023-12-03 16:04:09 26 4
gpt4 key购买 nike

在我在 Windows 7 中运行的 rails 2.3.8 应用程序中,尝试启动服务器时出现以下错误:

D:\app1>ruby script/server
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- active_support/core_ext (LoadError)
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from D:/app1/vendor/rails/activesupport/lib/active_support.rb:56
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from D:/app1/vendor/rails/railties/lib/commands/server.rb:1
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from script/server:3

在下面的自定义要求文件块中...第 36 行是“gem_original_require 路径”
  def require(path) # :doc:
gem_original_require path
rescue LoadError => load_error
if load_error.message =~ /#{Regexp.escape path}\z/ and
spec = Gem.searcher.find(path) then
Gem.activate(spec.name, "= #{spec.version}")
gem_original_require path
else
raise load_error
end
end

gem 列表如下:
actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8)
builder (3.0.0)
calendar_date_select (1.16.1)
cgi_multipart_eof_fix (2.5.0)
gem_plugin (0.2.3)
google4r-checkout (1.0.6.1)
i18n (0.5.0)
liquid (2.2.2)
money (3.5.5)
mongrel (1.1.5 x86-mingw32)
mysql (2.8.1 x86-mingw32)
rack (1.1.0)
rails (2.3.8)
rake (0.8.7)
rmagick (2.12.0 mswin32)

环顾了部分错误,但我不太确定从哪里开始。

最佳答案

仅查看堆栈跟踪...看起来您的应用程序在驱动器“D”上,而 ruby​​ 文件在驱动器“C”上。

也许当它执行要求时

filenames = Dir["#{File.dirname(__FILE__)}/core_ext/*.rb"].sort.map do |path|
File.basename(path, '.rb')
end

当它应该在“C”上时,它需要在“D”上的路径。这是我最好的猜测。祝你好运。

关于ruby-on-rails - 没有要加载的文件 -- active_support/core_ext (LoadError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4847293/

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