Rail's Cucumber 中的类型错误运行功能

发布于 2024-08-05 09:50:53 字数 3826 浏览 5 评论 0原文

我正在尝试为我的 Rails 应用程序运行 Cucumber 并不断收到此错误:

> superclass mismatch for class Point (TypeError)

此错误有一个巨大的堆栈跟踪,但除了缺少需求之外,它没有指向任何特定内容。这是跟踪:


rake 功能(在 /Users/rob/blue/blue_web 中) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I“/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/lib:lib” “/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/cucumber” --color --tags ~@wip --strict --format Pretty --drb 功能/manage_logins.feature 警告:没有 DRb 服务器正在运行。 本地运行功能:超类 类 Point 不匹配(TypeError) /Users/rob/blue/blue_web/app/models/point.rb:1 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in gem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inpolyglot_original_require' /Users/rob/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in 需要' /Users/rob/.gem/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependency.rb:158:in需要' /Users/rob/.gem/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:265:in require_or_load' /Users/rob/.gem/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependency.rb:224:in依赖” /Users/rob/.gem/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependency.rb:136:in require_dependency' /Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:414:inload_application_classes' /Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:413:in 每个' /Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:413:inload_application_classes' /Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:411:in 每个' /Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:411:inload_application_classes' /Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:197:in 进程' /Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in 发送' /Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in <代码>运行' /Users/rob/blue/blue_web/config/environment.rb:16 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:ingem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in polyglot_original_require' /Users/rob/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in需要'./features/support/env.rb:7 /Library/Ruby/Gems/1.8/gems/spork-0.7.2/lib/spork.rb:14:in prefork' ./features/support/env.rb:4 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:ingem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in polyglot_original_require' /Users/rob/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in需要' /Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/rb_support/rb_language.rb:107:in 加载代码文件' /Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/rb_support/rb_language.rb:48:instep_definitions_for' /Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/step_mother.rb:90:in 加载代码文件' /Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/step_mother.rb:82:inload_code_files' /Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/step_mother.rb:81:in 每个' /Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/step_mother.rb:81:inload_code_files' /Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/cli/main.rb:46:in 执行!' /Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/cli/main.rb:24:in 执行' /Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/cucumber:9 耙子中止!命令失败 状态(1): [/System/Library/Frameworks/Ruby.framework/...]

I'm trying to run Cucumber for my Rails application and keep getting this error:

> superclass mismatch for class Point (TypeError)

There's a huge stack trace from this error, but it does not point to anything specific except a missing requirement. Here's the trace:


rake features (in /Users/rob/blue/blue_web)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
-I "/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/lib:lib"
"/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/cucumber"
--color --tags ~@wip --strict --format pretty --drb
features/manage_logins.feature
WARNING: No DRb server is running.
Running features locally: superclass
mismatch for class Point (TypeError)
/Users/rob/blue/blue_web/app/models/point.rb:1
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
polyglot_original_require'
/Users/rob/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in
require'
/Users/rob/.gem/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in
require'
/Users/rob/.gem/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:265:in
require_or_load'
/Users/rob/.gem/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:224:in
depend_on'
/Users/rob/.gem/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:136:in
require_dependency'
/Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:414:in
load_application_classes'
/Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:413:in
each'
/Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:413:in
load_application_classes'
/Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:411:in
each'
/Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:411:in
load_application_classes'
/Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:197:in
process'
/Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in
send'
/Users/rob/.gem/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in
run'
/Users/rob/blue/blue_web/config/environment.rb:16
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
polyglot_original_require'
/Users/rob/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in
require' ./features/support/env.rb:7
/Library/Ruby/Gems/1.8/gems/spork-0.7.2/lib/spork.rb:14:in
prefork' ./features/support/env.rb:4
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
polyglot_original_require'
/Users/rob/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in
require'
/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/rb_support/rb_language.rb:107:in
load_code_file'
/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/rb_support/rb_language.rb:48:in
step_definitions_for'
/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/step_mother.rb:90:in
load_code_file'
/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/step_mother.rb:82:in
load_code_files'
/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/step_mother.rb:81:in
each'
/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/step_mother.rb:81:in
load_code_files'
/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/cli/main.rb:46:in
execute!'
/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/../lib/cucumber/cli/main.rb:24:in
execute'
/Users/rob/.gem/ruby/1.8/gems/cucumber-0.3.102/bin/cucumber:9
rake aborted! Command failed with
status (1):
[/System/Library/Frameworks/Ruby.framework/...]

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

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

发布评论

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

评论(1

梦纸 2024-08-12 09:50:53

我找到了这个问题的答案,它是类名与 mySQL geoSpatial 插件和我的架构冲突

我上了一堂名为 Point 的课,一切都很开心。然后我添加了(非常酷的)geoSpatial 插件来使用 mySQL 的地理索引功能。该插件还定义了一个Point 类。

冲突导致 Cucumber 失败。

如果您在自己的应用程序中看到此错误,请查找重复的错误!

I found the answer to this problem, it was a class name conflict with the mySQL geoSpatial plug-in and my schema.

I had a class named Point and everything was happy. Then I added (the very cool) geoSpatial plug-in to use mySQL's geo index features. This plug-in also defines a Point class.

The conflict was causing Cucumber to fail.

If you are seeing this error in your own application, look for duplicates!

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