2010-01-26 67 views
1

我想給here在Ubuntu

但是一個基本的RSpec的/黃瓜教程,當我運行命令「腳本/黃瓜功能」,我得到以下錯誤運行環境配置黃瓜/ rspec的面臨的問題並且無法繼續前進。是

Using the default profile... 
uninitialized constant Spec::Example (NameError) 
/home/badal/NetBeansProjects/blog/vendor/rails/activesupport/lib/active_support/dependencies.rb:442:in `load_missing_constant' 
/home/badal/NetBeansProjects/blog/vendor/rails/activesupport/lib/active_support/dependencies.rb:77:in `const_missing' 
/usr/lib/ruby/1.8/spec/interop/test/unit/testcase.rb:23 
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require' 
/home/badal/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require' 
/home/badal/NetBeansProjects/blog/vendor/rails/activesupport/lib/active_support/dependencies.rb:155:in `require' 
/usr/lib/ruby/1.8/spec/interop/test.rb:4 
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require' 
/home/badal/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require' 
/home/badal/NetBeansProjects/blog/vendor/rails/activesupport/lib/active_support/dependencies.rb:155:in `require' 
/var/lib/gems/1.8/gems/rspec-1.3.0/lib/spec/test/unit.rb:1 
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require' 
/home/badal/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require' 
/home/badal/NetBeansProjects/blog/vendor/rails/activesupport/lib/active_support/dependencies.rb:155:in `require' 
/var/lib/gems/1.8/gems/rspec-rails-1.3.2/lib/spec/rails.rb:13 
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require' 
/home/badal/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require' 
/home/badal/NetBeansProjects/blog/vendor/rails/activesupport/lib/active_support/dependencies.rb:155:in `require' 
/var/lib/gems/1.8/gems/cucumber-rails-0.2.4/lib/cucumber/rails/rspec.rb:3 
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require' 
/home/badal/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require' 
/home/badal/NetBeansProjects/blog/vendor/rails/activesupport/lib/active_support/dependencies.rb:155:in `require' 
/home/badal/NetBeansProjects/blog/features/support/env.rb:11 
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require' 
/home/badal/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require' 
/var/lib/gems/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/rb_support/rb_language.rb:124:in `load_code_file' 
/var/lib/gems/1.8/gems/cucumber-0.6.2/lib/cucumber/step_mother.rb:84:in `load_code_file' 
/var/lib/gems/1.8/gems/cucumber-0.6.2/lib/cucumber/step_mother.rb:76:in `load_code_files' 
/var/lib/gems/1.8/gems/cucumber-0.6.2/lib/cucumber/step_mother.rb:75:in `each' 
/var/lib/gems/1.8/gems/cucumber-0.6.2/lib/cucumber/step_mother.rb:75:in `load_code_files' 
/var/lib/gems/1.8/gems/cucumber-0.6.2/lib/cucumber/cli/main.rb:48:in `execute!' 
/var/lib/gems/1.8/gems/cucumber-0.6.2/lib/cucumber/cli/main.rb:20:in `execute' 
/var/lib/gems/1.8/gems/cucumber-0.6.2/bin/cucumber:8 
script/cucumber:9:in `load' 
script/cucumber:9 

安裝的寶石如下:

aaronp-frex (1.0.1) 
actionmailer (2.3.5) 
actionpack (2.3.5) 
activerecord (2.3.5) 
activeresource (2.3.5) 
activesupport (2.3.5) 
brynary-webrat (0.4.0) 
builder (2.1.2) 
cucumber (0.6.2) 
cucumber-rails (0.2.4) 
database_cleaner (0.4.3) 
diff-lcs (1.1.2) 
json_pure (1.2.0) 
nokogiri (1.4.1) 
polyglot (0.2.9) 
rack (1.1.0, 1.0.1) 
rack-test (0.5.3) 
rails (2.3.5) 
rake (0.8.7) 
rspec (1.3.0) 
rspec-rails (1.3.2) 
rubygems-update (1.3.5) 
term-ansicolor (1.0.4) 
treetop (1.4.3) 
webrat (0.7.0) 

我使用: 紅寶石1.8.7(2009-06-12 PATCHLEVEL 174)[x86_64的Linux的]

任何線索? TIA。

+0

巴達爾先生,你能把你的堆棧跟蹤格式化爲代碼嗎?單擊編輯,突出顯示堆棧跟蹤,然後單擊101/010,然後保存。謝謝! – 2010-01-26 05:16:47

+0

完成..謝謝指出! – 2010-01-26 06:01:06

+0

嘗試_cucumber_而不是_script/cucumber_。它可能工作。 – Waseem 2010-01-26 08:10:33

回答

1

好的......我終於明白了。

問題是,除了安裝爲gem的rails(2.3.5)之外,我還在Ubuntu上使用「sudo apt-get install」安裝了rails(2.3.2)。這導致了不匹配並導致了黃瓜的編譯問題(除此之外,它還導致了RubyMine和IntelliJ IDEA的問題)。

解決辦法:

  1. 使用新立得軟件包管理器
  2. 刪除軌道2.3.2創建符號鏈接到軌寶石「須藤LN -s /var/lib/gems/1.8/斌/導軌 在/ usr/bin中/軌」

現在,你是啓動和運行!歡呼!!

現在運行腳本/黃瓜正常工作!