【问题标题】:Unable to activate faraday_middleware-0.9.0 // Gem::LoadError // trying to run the pocket-ruby gem无法激活 faraday_middleware-0.9.0 // Gem::LoadError // 试图运行 pocket-ruby gem
【发布时间】:2014-04-12 22:53:03
【问题描述】:

我正在尝试运行 pocket-ruby gem,在我克隆 repo 和 bundle 后,它会引发此错误:

Unable to activate faraday_middleware-0.9.0, because faraday-0.9.0 conflicts with faraday
(< 0.9, >= 0.7.4)

pocket-ruby gem 的 gemspecfile 如下所示:

require File.expand_path('../lib/pocket/version', __FILE__)

Gem::Specification.new do |s|
 s.add_development_dependency('sinatra', '~> 1.3.3')
 s.add_development_dependency('multi_xml')

 s.add_runtime_dependency('faraday', ['>= 0.7', '< 0.9'])
 s.add_runtime_dependency('faraday_middleware', '~> 0.8')

 s.add_runtime_dependency('multi_json', '>= 1.0.3', '~> 1.0')
 s.add_runtime_dependency('hashie',  '>= 0.4.0')
 s.authors = ["Turadg Aleahmad","Jason Ng PT"]
 s.description = %q{A Ruby wrapper for the Pocket API v3 (Add, Modify and Retrieve)}
 s.email = ['turadg@aleahmad.net',"me@jasonngpt.com"]
 s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
 s.files = `git ls-files`.split("\n")
 s.homepage = 'https://github.com/turadg/pocket-ruby'
 s.name = 'pocket-ruby'
 s.platform = Gem::Platform::RUBY
 s.require_paths = ['lib']
 s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') 
 if s.respond_to?    :required_rubygems_version=
 s.rubyforge_project = s.name
 s.summary = %q{Ruby wrapper for the Pocket API v3}
 s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
 s.version = Pocket::VERSION
end

我搞砸了更改有问题的两个依赖项的版本,但没有运气,因为我想我不完全确定错误在说什么。想法?

【问题讨论】:

    标签: ruby api ruby-on-rails-4 gem bundle


    【解决方案1】:

    两个版本说明符之间存在冲突 - ~&gt; 0.8 表示“0.x 形式的任何版本”,但 &lt; 0.9 表示实际上不允许使用 0.9

    您需要确定其中哪些需要更改 - 也许 ~&gt; 0.8 应该真的是 ~&gt; 0.8.0,这将指定“0.8.x 形式的任何版本”。

    有关悲观约束运算符 (~&gt;) 的更多信息:

    Meaning of tilde-greater-than (~>) in version requirement?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-12-12
      • 2018-06-21
      • 2011-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-12
      • 1970-01-01
      相关资源
      最近更新 更多