没有这样的文件加载 - zip / zip(MissingSourceFile)运行黄瓜时

时间:2010-06-29 13:25:21

标签: ruby-on-rails cucumber

很长一段时间我没有在我的项目中运行黄瓜。它之前运行良好但现在,当我尝试运行黄瓜功能时,我有这个错误:

使用默认配置文件...

no such file to load -- zip/zip (MissingSourceFile)
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/home/florence/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require'
/home/florence/NetBeansProjects/famicity/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require'
/home/florence/NetBeansProjects/famicity/app/controllers/albums_controller.rb:1
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/home/florence/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require'
/home/florence/NetBeansProjects/famicity/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require'
/home/florence/NetBeansProjects/famicity/vendor/rails/activesupport/lib/active_support/dependencies.rb:265:in `require_or_load'
/home/florence/NetBeansProjects/famicity/vendor/rails/activesupport/lib/active_support/dependencies.rb:224:in `depend_on'
/home/florence/NetBeansProjects/famicity/vendor/rails/activesupport/lib/active_support/dependencies.rb:136:in `require_dependency'
/home/florence/NetBeansProjects/famicity/vendor/rails/railties/lib/initializer.rb:414:in `load_application_classes'
/home/florence/NetBeansProjects/famicity/vendor/rails/railties/lib/initializer.rb:413:in `each'
/home/florence/NetBeansProjects/famicity/vendor/rails/railties/lib/initializer.rb:413:in `load_application_classes'
/home/florence/NetBeansProjects/famicity/vendor/rails/railties/lib/initializer.rb:411:in `each'
/home/florence/NetBeansProjects/famicity/vendor/rails/railties/lib/initializer.rb:411:in `load_application_classes'
/home/florence/NetBeansProjects/famicity/config/../vendor/rails/railties/lib/initializer.rb:197:in `process'
/home/florence/NetBeansProjects/famicity/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
/home/florence/NetBeansProjects/famicity/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
/home/florence/NetBeansProjects/famicity/config/environment.rb:14
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/home/florence/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require'
/home/florence/NetBeansProjects/famicity/features/support/env.rb:8
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/home/florence/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/rb_support/rb_language.rb:124:in `load_code_file'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/step_mother.rb:84:in `load_code_file'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/step_mother.rb:76:in `load_code_files'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/step_mother.rb:75:in `each'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/step_mother.rb:75:in `load_code_files'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/cli/main.rb:48:in `execute!'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/cli/main.rb:20:in `execute'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/cucumber:8
/usr/bin/cucumber:19:in `load'
/usr/bin/cucumber:19

在此,我的宝石列表:

actionmailer (2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 1.3.3)
actionpack (2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 1.13.3)
actionwebservice (1.2.3)
activerecord (2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 1.15.3)
activeresource (2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.3.2)
activesupport (2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 1.4.2)
adzap-ar_mailer (2.1.8, 2.1.5)
aws-s3 (0.6.2)
builder (2.1.2)
calendar_date_select (1.16.1, 1.15)
cgi_multipart_eof_fix (2.5.0)
chronic (0.2.3)
color (1.4.1)
contacts (1.2.3)
cucumber (0.6.2)
cucumber-rails (0.2.4)
daemons (1.0.10)
database_cleaner (0.5.0, 0.4.3)
devise (1.0.7)
diff-lcs (1.1.2)
digitalpardoe-rflickr (1.1.2)
eventmachine (0.12.8)
facebooker (1.0.44)
fastercsv (1.5.0)
fastthread (1.0.7)
gdata (1.1.1)
gem_plugin (0.2.3)
geokit (1.5.0)
hoe (2.3.2)
hpricot (0.8.1)
icalendar (1.1.4)
json (1.1.7)
json_pure (1.4.3, 1.2.0)
levenshtein (0.2.0)
lockfile (1.4.3)
macaddr (1.0.0)
memcache-client (1.7.4)
mime-types (1.16)
mocha (0.9.7)
money (2.1.4)
mongrel (1.1.5)
mysql (2.8.1, 2.7)
net-http-persistent (1.2.1)
newrelic_rpm (2.9.9)
nokogiri (1.4.1)
objectify-xml (0.2.3)
packet (0.1.15)
paperclip (2.3.1.1)
paypal (2.0.0)
pdf-writer (1.1.8)
polyglot (0.2.9)
rack (1.0.1, 1.0.0)
rack-test (0.5.3)
rails (2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.3.2)
rake (0.8.7)
rc-rest (4.0)
rest-client (1.0.3)
rflickr (2006.02.01)
rmagick (2.13.1)
rspec (1.3.0)
rspec-rails (1.3.2)
ruby-picasa (0.2.1)
rubyforge (2.0.4, 1.0.4)
rubygems-update (1.3.4)
rvideo-tecnobrat (0.9.4)
selenium-client (1.2.18)
term-ansicolor (1.0.4)
thin (1.2.7, 1.2.2)
transaction-simple (1.4.0)
treetop (1.4.3)
trollop (1.16.2)
ultrasphinx (1.11)
uuid (2.3.1)
validates_timeliness (2.2.2)
viddler (0.2.2)
warden (0.10.7)
webrat (0.7.0)
will_paginate (2.2.2)
xml-magic (0.1.1)
xml-simple (1.0.12)

任何帮助都将不胜感激。 提前谢谢。

6 个答案:

答案 0 :(得分:10)

上述解决方案无效。我的解决方案是要求rubyzip版本小于1.0,即

gem 'rubyzip', '~> 0.9.9'

似乎最新的selenium-webdriver现在需要rubyzip < 1.0.0所以这不应该是一个问题,但如果发生在其他人身上就会发布。

答案 1 :(得分:5)

我找到了答案,问题是关于一个名为“rubyzip”的宝石在我的宝石列表中遗漏了。

答案 2 :(得分:1)

我不太明白这个错误的来源。这似乎是Active Support的缺失依赖。无论如何,我能够通过显式添加gem并在我的Gemfile中需要它来解决错误:

gem 'rubyzip', :require => 'zip/zip'

答案 3 :(得分:0)

将rubyzip从0.9.9移至1.0.0时,这是一个突破界面的更改。问题描述为here

作为工作的捷径,您可能对zip-zip gem感兴趣。

答案 4 :(得分:0)

在更新selenium-webdriver后尝试运行黄瓜时,我也遇到了这个问题。

最新版本的selenium现在需要rubyzip ~> 1.0,您需要将其放入Gemfile并明确要求:

    gem 'rubyzip', require: 'zip'

答案 5 :(得分:0)

当使用phusion乘客时,似乎宝石必须全局安装。

当我从我的项目目录中运行'gem install'时,它显示gem已安装,但仍导致'没有这样的文件加载...'错误。

在预感中,我走到了项目目录之外并做了一个'宝石列表'并且上面安装的宝石没有列出,所以我在项目目录之外做了'gem install'并且修复了错误。

请注意,这不仅仅是铁路的Phusion Passenger实施。