gpt4 book ai didi

ruby-on-rails - 如何从 Rails 应用程序中卸载 Cucumber?

转载 作者:数据小太阳 更新时间:2023-10-29 08:10:32 25 4
gpt4 key购买 nike

我试图注释掉 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 应用程序中使用 Cucumber 的所有位置进行文本搜索之外,是否还有任何特殊问题?

最佳答案

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

出于某种原因,删除 Cucumber 导致 Spork 导致此错误。我不明白为什么,但 Spork 过去工作正常......现在不行了:/

解决方案是移除 spork。

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

我想这会在较新的版本中得到修复,但它可能不会为我们这些使用 Rails 3.0.7 的人打补丁

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

无论如何,我希望能帮助到其他人。

关于ruby-on-rails - 如何从 Rails 应用程序中卸载 Cucumber?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5997471/

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