简体   繁体   English

RubyGems安装错误的代码

[英]RubyGems installing wrong code

When I install the gem ipa_reader the code does not install correctly. 当我安装gem ipa_reader ,代码无法正确安装。 In the file /lib/ipa_reader/ipa_file.rb , the code that I get is 在文件/lib/ipa_reader/ipa_file.rb ,我得到的代码是

Zip::ZipFile.foreach(file_path) { |f| info_plist_file = f if f.name.match(regex) } Zip::ZipFile.foreach(file_path) { |f| info_plist_file = f if f.name.match(regex) } . Zip::ZipFile.foreach(file_path) { |f| info_plist_file = f if f.name.match(regex) } Which I guess is from an older version. 我猜这是旧版本。 What I should get, and what shows up on github is 我应该得到什么,以及github上出现的是什么

Zip::File.foreach(file_path) { |f| info_plist_file = f if f.name.match(regex) }.

What is going on? 到底是怎么回事?

Gemfile 的Gemfile

source 'https://rubygems.org'

gem 'rails', '4.1.4'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc

group :development do
  gem 'spring'
  gem 'pry-rails'
end

gem 'CFPropertyList', '~> 2.1.1'
gem 'rubyzip'
gem 'aws-sdk'
gem 'rufus-scheduler'
gem 'omniauth-google-oauth2'
gem 'figaro'
gem 'ipa_reader' , '~> 0.7.1'

When you are installing from rubygems you are downloading stable 0.7.1 version, while at github there is latest development version. 当您从rubygems安装时,您正在下载稳定的0.7.1版本,而在github上则有最新的开发版本。 If you want to use this one (although it is not recommended to live on the bleeding edge), specify git url in your gemfile 如果你想使用这个(虽然不建议生活在最前沿),在你的gemfile中指定git url

gem 'ipa_reader', git: 'https://github.com/schlu/Ipa-Reader.git'

refer here for more info http://bundler.io/v1.3/git.html 有关详细信息,请参阅此处http://bundler.io/v1.3/git.html

This looks like a mistake from the gem author. 这看起来像宝石作者的错误。 A github repo is not synched to rubygems, so the gem published to rubygems does not necessarily have to be the exact same thing as on github. github repo不与rubygems同步,因此发布到rubygems的gem不一定必须与github完全相同。

You can easily tell bundler to user the code from github, by doing: 通过执行以下操作,您可以轻松地告诉bundler使用github中的代码:

gem 'ipa_reader', github: 'schlu/Ipa-Reader'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM