6

我刚刚添加了 gem 'carrierwave',它打破了 4.0 的护栏。我添加了 ruby​​zip gem,但它不能解决问题。我不能再运行任何测试,我不知道如何解决这个问题。

守卫--调试

19:11:40 - DEBUG - Command execution: growlnotify --version
19:11:40 - DEBUG - Command execution: emacsclient --eval '1' 2> /dev/null || echo 'N/A'
19:11:40 - INFO - Guard is using TerminalTitle to send notifications.
19:11:40 - DEBUG - Command execution: hash stty
19:11:40 - DEBUG - Guard starts all plugins
19:11:40 - DEBUG - Hook :start_begin executed for Guard::Spork
19:11:40 - DEBUG - Command execution: ps aux | grep -v guard | awk '/spork/&&!/awk/{print $2;}'
19:11:40 - DEBUG - Killing Spork servers with PID: 
19:11:40 - INFO - Starting Spork for RSpec
19:11:40 - DEBUG - guard-spork command execution: ["exec", "spork", "-p", "8989"]
Using RSpec, Rails
Preloading Rails environment
cannot load such file -- zip/zip (LoadError)
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.0.0/lib/selenium/webdriver/common/zipper.rb:1:in `require'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.0.0/lib/selenium/webdriver/common/zipper.rb:1:in `<top (required)>'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.0.0/lib/selenium/webdriver/common.rb:9:in `require'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.0.0/lib/selenium/webdriver/common.rb:9:in `<top (required)>'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.0.0/lib/selenium/webdriver.rb:29:in `require'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.0.0/lib/selenium/webdriver.rb:29:in `<top (required)>'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.0.0/lib/selenium-webdriver.rb:1:in `require'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.0.0/lib/selenium-webdriver.rb:1:in `<top (required)>'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/Volumes/Khaya/pumula/config/application.rb:7:in `<top (required)>'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/bundler/gems/spork-rails-3224f84d8c31/lib/spork/app_framework/rails.rb:49:in `require'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/bundler/gems/spork-rails-3224f84d8c31/lib/spork/app_framework/rails.rb:49:in `preload_rails'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/bundler/gems/spork-rails-3224f84d8c31/lib/spork/app_framework/rails.rb:7:in `preload'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/spork-1.0.0rc3/lib/spork/test_framework.rb:134:in `block in preload'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/spork-1.0.0rc3/lib/spork.rb:62:in `exec_prefork'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/spork-1.0.0rc3/lib/spork/test_framework.rb:120:in `preload'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/spork-1.0.0rc3/lib/spork/run_strategy/forking.rb:25:in `preload'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/spork-1.0.0rc3/lib/spork/runner.rb:74:in `run'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/spork-1.0.0rc3/lib/spork/runner.rb:10:in `run'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/gems/spork-1.0.0rc3/bin/spork:10:in `<top (required)>'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/bin/spork:23:in `load'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/bin/spork:23:in `<main>'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
/Users/vezu/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'

宝石文件

source 'https://rubygems.org'
gem 'rails', '4.0.0'
gem 'pg'
group :development, :test do
  gem 'rspec-rails', '2.13.1'
  gem 'guard-rspec', '2.5.0'
  gem 'spork-rails', github: 'sporkrb/spork-rails'
  gem 'guard-spork', '1.5.0'
  gem 'childprocess', '0.3.9'
  gem 'factory_girl_rails', '>= 4.2.0'
end
group :test do
  gem 'selenium-webdriver', '2.0.0'
  gem 'capybara', '2.1.0'
  gem 'growl', '1.0.3'
end
group :development do
  gem 'better_errors'
  gem 'binding_of_caller'
  gem 'meta_request'
end
gem 'sass-rails', '~> 4.0.0'
gem 'anjlab-bootstrap-rails', '>= 3.0.0.0', :require => 'bootstrap-rails'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'cocoon', :git => 'git://github.com/nathanvda/cocoon'
gem 'simple_form', '~> 3.0.0.rc'
gem 'country_select'
gem 'friendly_id', '5.0.0.beta4' # Note: You MUST use 5.0.0 or greater for Rails 4.0+   
gem 'figaro'
gem 'devise', github: 'plataformatec/devise', branch: 'rails4'
gem 'rolify'
gem 'cancan'
gem 'stripe'
gem 'stripe_event'
gem 'carrierwave'
gem 'rmagick', '2.13.2'
gem 'fog'
group :production do
  gem 'rails_12factor', '0.0.2'
end
gem 'turbolinks'

logo_uploader.rb

**# encoding: utf-8

class LogoUploader < CarrierWave::Uploader::Base
  include CarrierWave::RMagick

  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end

  version :thumb do
    process :resize_to_fill => [200,200]
  end

  def cache_dir
    "#{Rails.root}/tmp/uploads"
  end

end**
4

3 回答 3

29

我需要更新gem 'selenium-webdriver', '2.0.0“到gem 'selenium-webdriver', '~> 2.35.1”,问题就消失了。

类似问题ruby​​ on rails 教程第 3.2 节 rspec 测试错误

于 2013-08-30T06:57:00.667 回答
3

添加gem "zip-zip", "~> 0.1" and gem "rubyzip", "~> 1.0.0"应该可以解决问题。

于 2013-10-15T20:20:59.453 回答
2

RubyZip 1.0.0 版更改了几个类名和文件的位置以要求。当您的项目依赖项之一依赖于 v1.0.0 接口,而另一个依赖于 v0.9.9 接口时,这就引入了问题。为了缓解这个问题,请尝试将zip-zip gem 添加到您的项目中。它使用 v0.9.9 接口为您的依赖项提供了一个简单的适配器,允许您升级到 RubyZip v1.0.0。

于 2013-09-21T04:18:12.593 回答