无法激活测试单元(= 1.2.3),已激活测试单元2.3.0
最近我在 Rails 2.3.5 中添加了 rspec 测试,但我无法简单地运行 rake -T
命令。然后我发现 Rails 3 -如果我使用 RSpec,我可以删除“test”文件夹吗? 并且我在 Gemfile 中添加了 gem test-unit
。这是向我显示以下消息。
rake aborted!
can't activate test-unit (= 1.2.3), already activated test-unit-2.3.0. Make sure all dependencies are added to Gemfile.
Recently I added rspec test in my rails 2.3.5 but I wasn't able to run simply rake -T
command. Then I found Rails 3 - If I'm using RSpec, can I just delete the 'test' folder? and I added gem test-unit
in my Gemfile. This is showing me below message.
rake aborted!
can't activate test-unit (= 1.2.3), already activated test-unit-2.3.0. Make sure all dependencies are added to Gemfile.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您正在尝试加载旧版本的
test-unit
,其中新版本已激活。要修复此错误,请执行以下任一操作: 1.删除新版本的
test-unit
2.在 rake 中查找
test-unit
1.2.3
版本文件并将其替换为2.3.0
You are trying to load old version of
test-unit
where new version is already activated. To fix this bug do either one1.Removing your new version of
test-unit
2.Find
test-unit
1.2.3
version in rake file and replace it with2.3.0
您必须执行类似 config.gem 'test-unit', :version => 的操作'1.2.3' 位于 test.rb 中的某处。删除此行并查看是否有效。
You must to doing something like
config.gem 'test-unit', :version => '1.2.3'
somewhere in test.rb. Remove this line and see if that works.尝试运行
这将在您的捆绑包上下文中运行 rake 命令,该命令应锁定所有 gem 的正确版本。
Try running
That will run the rake command in the context of your bundle which should lock in the correct version of all of your gems.