LoadError: 无法加载此类文件 -- test/unit/error

Posted

技术标签:

【中文标题】LoadError: 无法加载此类文件 -- test/unit/error【英文标题】:LoadError: cannot load such file -- test/unit/error 【发布时间】:2015-02-11 07:16:07 【问题描述】:

我正在尝试使用 ruby​​ 1.9.3 在 Rails 3.2.21 中安装 insoshi,一切都很好,但现在我在尝试 $rake gems:install 时出现错误,但出现错误

rake aborted!
LoadError: cannot load such file -- test/unit/error
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
53:in `block in require'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
21:in `new_constants_in'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
53:in `require'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/deprecation.rb:22
4:in `<top (required)>'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
53:in `block in require'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
21:in `new_constants_in'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
53:in `require'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support.rb:37:in `<top (r
equired)>'
C:/Sites/insoshi/vendor/rails/railties/lib/tasks/misc.rake:11:in `<top (required
)>'
C:/Sites/insoshi/vendor/rails/railties/lib/tasks/rails.rb:4:in `load'
C:/Sites/insoshi/vendor/rails/railties/lib/tasks/rails.rb:4:in `block in <top (r
equired)>'
C:/Sites/insoshi/vendor/rails/railties/lib/tasks/rails.rb:4:in `each'
C:/Sites/insoshi/vendor/rails/railties/lib/tasks/rails.rb:4:in `<top (required)>
'
C:/Sites/insoshi/Rakefile:10:in `<top (required)>'
(See full trace by running task with --trace)

我对 Rails 完全陌生。希望得到帮助

【问题讨论】:

【参考方案1】:

尝试将以下 gem 添加到您的 gem 文件中

gem 'test-unit'

希望它能解决你的问题。

【讨论】:

以上是关于LoadError: 无法加载此类文件 -- test/unit/error的主要内容,如果未能解决你的问题,请参考以下文章

机架错误 - LoadError:无法加载此类文件

Ruby loaderror 无法加载此类文件

LoadError: 无法加载此类文件 -- 目录/文件名

rails 无法加载此类文件 -- rake (LoadError)

LoadError: 无法加载此类文件 -- test/unit/error

无法安装 gem - 无法构建 gem 本机扩展 - 无法加载此类文件 - mkmf (LoadError)