【问题标题】:Having trouble getting cucumber 6.3 to run on rails 2.3.4无法让黄瓜 6.3 在 Rails 2.3.4 上运行
【发布时间】:2011-01-28 08:55:36
【问题描述】:

我试图让黄瓜运行但没有运气。这是我看到的错误:

cucumber features Using the default profile... no such file to

加载 -- 测试/ (MissingSourceFile) /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' /Library/Ruby/Gems/1.8/gems/polyglot-0.3.0/lib/polyglot.rb:65:in require' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in require' /Users/yakovrabinovich/Starstreet/starstreet/vendor/gems/cucumber-0.6.3/bin/../lib/cucumber/rails/world.rb:11 /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' /Library/Ruby/Gems/1.8/gems/polyglot-0.3.0/lib/polyglot.rb:65:in require' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in require' /Library/Ruby/Gems/1.8/gems/cucumber-rails-0.3.0/lib/cucumber/rails/rspec.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' /Library/Ruby/Gems/1.8/gems/polyglot-0.3.0/lib/polyglot.rb:65:in require' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in require' /Users/yakovrabinovich/Starstreet/starstreet/features/support/env.rb:11 /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' /Library/Ruby/Gems/1.8/gems/polyglot-0.3.0/lib/polyglot.rb:65:in require' /Library/Ruby/Gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/rb_support/rb_language.rb:124:in load_code_file' /Library/Ruby/Gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/step_mother.rb:85:in load_code_file' /Library/Ruby/Gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/step_mother.rb:77:in load_code_files' /Library/Ruby/Gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/step_mother.rb:76:in each' /Library/Ruby/Gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/step_mother.rb:76:in load_code_files' /Library/Ruby/Gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/cli/main.rb:48:in execute!' /Library/Ruby/Gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/cli/main.rb:20:in 执行' /Library/Ruby/Gems/1.8/gems/cucumber-0.6.3/bin/cucumber:8 /usr/bin/cucumber:19:in `load' /usr/bin/cucumber:19

这是我的宝石:

Yakov-Rabinovichs-MacBook:1.8 yakovrabinovich$ 宝石清单

* 本地宝石 *

aasm (2.1.3)
acl9 (0.11.0)
actionmailer (2.3.4, 2.2.2, 1.3.6)
actionpack (2.3.4, 2.2.2, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.3.4, 2.2.2, 1.15.6)
activeresource (2.3.4, 2.2.2)
activesupport (2.3.4, 2.2.2, 1.4.4)
acts_as_ferret (0.4.3)
authlogic (2.1.3)
bgetting-hominid (1.2.0)
builder (2.1.2)
capistrano (2.5.2)
capistrano-ext (1.2.1)
cgi_multipart_eof_fix (2.5.0)
chronic (0.2.3)
columnize (0.3.1)
configatron (2.5.1)
cucumber (0.6.3)
cucumber-rails (0.3.0)
daemons (1.0.10)
database_cleaner (0.5.0)
diff-lcs (1.1.2)
dnssd (0.6.0)
factory_girl (1.2.3)
fastthread (1.0.1)
fcgi (0.8.7)
ferret (0.11.6)
gem_plugin (0.2.3)
gemcutter (0.4.1)
highline (1.5.0)
hoe (2.5.0)
hominid (2.1.0)
hpricot (0.6.164)
json (1.2.0)
json_pure (1.2.0)
libxml-ruby (1.1.2)
linecache (0.43)
mocha (0.9.8)
mongrel (1.1.5)
needle (1.3.0)
net-scp (1.0.1)
net-sftp (2.0.1, 1.1.1)
net-ssh (2.0.16, 2.0.4, 1.1.4)
net-ssh-gateway (1.0.0)
nokogiri (1.4.1)
oauth (0.3.6)
pg (0.8.0)
polyglot (0.3.0)
rack (1.0.1)
rack-test (0.5.3)
rails (2.3.4, 2.2.2, 1.2.6)
rake (0.8.7, 0.8.3)
RedCloth (4.1.1)
rspec (1.3.0)
rspec-rails (1.3.2)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
ruby-hmac (0.4.0)
ruby-openid (2.1.2)
ruby-yadis (0.3.4)
rubyforge (2.0.3)
rubygems-update (1.3.5)
rubynode (0.1.5)
sqlite3-ruby (1.2.4)
term-ansicolor (1.0.4)
termios (0.9.4)
test-unit (1.2.3)
thoughtbot-factory_girl (1.2.2)
thoughtbot-shoulda (2.10.2)
treetop (1.4.4)
whenever (0.4.1)
will_paginate (2.3.11)
xmpp4r (0.4)
yamler (0.1.0)

任何帮助将不胜感激!

【问题讨论】:

  • rake gems RAILS_ENV=cucumber 告诉你什么?

标签: ruby-on-rails ruby cucumber


【解决方案1】:

尝试设置环境变量 RSPEC,它看起来像是在您的测试/单元目录中查找(假设您当然使用的是 rspec!)

export RSPEC=true

这也可能是 config/cucumber.yaml 中的默认设置正在寻找一个不存在的文件。暂时重命名这个文件,看看它是否开始工作。我不得不从我的身上去除很多杂物。作为参考,它看起来像这样:

<%
# rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
# rerun_opts = rerun.to_s.strip.empty? ? "--format progress features" : "--format           #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
# std_opts = "#{rerun_opts} --format rerun --out rerun.txt --strict --tags ~@wip"
std_opts = "--format progress features"
%>
default: <%= std_opts %>
wip: --tags @wip:3 --wip features

如你所见,我评论了很多。

【讨论】:

    【解决方案2】:

    您在安装 Cucumber gems 后是否运行了 Cucumber 生成器?这一切都记录在这里。 http://wiki.github.com/aslakhellesoy/cucumber/ruby-on-rails

    我似乎记得当我忘记在自己的安装中运行生成器时遇到了那个错误。您的错误提到的“默认配置文件”在运行生成器时创建的 cucumber.yml 文件中被引用。

    ruby 脚本/生成黄瓜

    【讨论】:

    • 嗨,是的,我肯定有那个文件并且记得运行生成器。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-12-04
    • 1970-01-01
    • 2011-04-10
    • 1970-01-01
    • 2017-04-20
    • 1970-01-01
    • 2022-11-28
    相关资源
    最近更新 更多