Je suis en train de courir concombre pour mon application Rails et continuer à obtenir cette erreur:Erreur de type fonction en cours d'exécution dans le concombre Rail
> superclass mismatch for class Point (TypeError)
Il y a une énorme trace de la pile de cette erreur, mais il ne pointe pas à quoi que ce soit spécifique sauf une exigence manquante. Voici la 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 [email protected] --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:inrequire' /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:inrequire_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:inrequire_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:ineach' /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:ineach' /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:inprocess' /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:inrun' /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:inpolyglot_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:inprefork' ./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:inpolyglot_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:inload_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:inload_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:ineach' /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:inexecute!' /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/...]
Quelle sorte de bibliothèque boiteuse ajoute des classes à la portée globale? c'est ce à quoi servent le module et les espaces de noms. –
J'ai eu un problème similaire (http://stackoverflow.com/questions/1736747/how-to-resolve-rails-model-namespace-collision) - très ennuyeux. Les auteurs de gemmes doivent prendre plus de précautions pour éviter d'encombrer l'espace de noms de premier niveau. – zetetic
Oui, mais vous aurez également besoin d'espaces de noms toutes les tables créées aussi, n'oubliez pas. Ne devrait pas être un problème si la gemme est assez configurable. – Ghoti