如何从 Rails 应用程序中卸载 Cucumber?

发布于 2024-11-07 07:19:56 字数 6110 浏览 0 评论 0原文

我尝试注释掉 gem 文件,每当我使用 rake 时,都会出现以下错误:

(in /home/egervari/Projects/training)
rake aborted!
undefined method `basename' for "/usr/local/lib/ruby/gems/1.9.1/gems/actionmailer-3.0.7":String
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:601:in `block in latest_partials'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:600:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:600:in `latest_partials'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:587:in `block in latest_load_paths'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:586:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:586:in `latest_load_paths'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb:62:in `block (2 levels) in deprecate'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib/spork.rb:112:in `other_spork_gem_load_paths'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib/spork.rb:105:in `detect_and_require'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib/spork/test_framework.rb:167:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.2/lib/rspec/monkey/spork/test_framework/rspec.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.2/lib/rspec/monkey.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.2/lib/rspec/core.rb:65:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.5.0/lib/rspec/rails/tasks/rspec.rake:1:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `block in load'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.5.0/lib/rspec-rails.rb:10:in `block in <class:Railtie>'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/railtie.rb:184:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/railtie.rb:184:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/railtie.rb:184:in `load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:140:in `block in load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application/railties.rb:11:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application/railties.rb:11:in `all'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:140:in `load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/home/egervari/Projects/training/Rakefile:7:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2017:in `block in load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2000:in `block in run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19:in `<main>'

除了上述问题之外...除了对我的 Rails 应用程序中使用黄瓜的所有位置进行文本搜索之外,还有其他问题吗?特别的陷阱?

I tried to comment out the gem files and whenever I use rake, I get the following error:

(in /home/egervari/Projects/training)
rake aborted!
undefined method `basename' for "/usr/local/lib/ruby/gems/1.9.1/gems/actionmailer-3.0.7":String
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:601:in `block in latest_partials'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:600:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:600:in `latest_partials'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:587:in `block in latest_load_paths'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:586:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:586:in `latest_load_paths'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb:62:in `block (2 levels) in deprecate'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib/spork.rb:112:in `other_spork_gem_load_paths'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib/spork.rb:105:in `detect_and_require'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib/spork/test_framework.rb:167:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.2/lib/rspec/monkey/spork/test_framework/rspec.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.2/lib/rspec/monkey.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.2/lib/rspec/core.rb:65:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.5.0/lib/rspec/rails/tasks/rspec.rake:1:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `block in load'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.5.0/lib/rspec-rails.rb:10:in `block in <class:Railtie>'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/railtie.rb:184:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/railtie.rb:184:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/railtie.rb:184:in `load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:140:in `block in load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application/railties.rb:11:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application/railties.rb:11:in `all'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:140:in `load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/home/egervari/Projects/training/Rakefile:7:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2017:in `block in load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2000:in `block in run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19:in `<main>'

In addition to the above problem... besides doing a text-search for all the places in my rails app that uses cucumber, is there any special gotchas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

翻身的咸鱼 2024-11-14 07:19:56

看来我已经自己解决了这个问题(我认为任何人都很难盲目地解决这个问题)。

由于某种原因,删除 Cucumber 导致 Spork 导致此错误。我不明白为什么,但 Spork 曾经工作得很好......但现在不行了:/

解决方案是删除 spork。

我认为 Spork 或其他地方存在错误。和路径有关系。其他人注意到代码在字符串上调用 basename,但它应该使用 File.basename(the_string) 代替。

我想这个问题在新版本中得到了修复,但对于我们这些使用 Rails 3.0.7 的人来说可能不会被修补。

Anyhoo,如果你遇到这个问题,只需删除 Spork 即可。我知道这很糟糕,但 Spork 无论如何都有点承诺过多而交付不足 - 至少对我来说:( 根据我本周使用它的经验,它带来的头痛和问题比它节省的时间还要多。所以, 无论如何,是时候让 Spork 离开了,

我希望这对其他人有帮助。

It would appear that I have fixed the problem on my own (and it would have been infinitely hard for anyone to fix blindly me thinks).

For some reason, removing Cucumber caused Spork to cause this error. I do not understand why, but Spork used to work fine... and now it doesn't :/

The solution was to remove spork.

I think there is a bug in either Spork, or somewhere down the line. It has something to do with the paths. Someone else noticed that the code is calling basename on a string, but it should have used File.basename(the_string) instead.

I would imagine that this got fixed in newer versions, but it probably won't be patched for those of us using Rails 3.0.7

Anyhoo, if you're getting this problem, just remove Spork. I know it sucks, but Spork kind of over-promises and under-delivers anyway - at least for me :( In my experience of using it this week, it has caused more headaches and problems than the time it has saved me. So, it's time for Spork to go.

Anyway, I hope that helps others.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文