bundle install gemspec error spree_social.gemspec

时间:2016-06-08 10:21:03

标签: ruby-on-rails bundle spree

在我的应用中,当我正在运行bundle install时,我遇到了错误。

  

供应商/宝石/ spree_social / spree_social.gemspec   无效。请修复此gemspec。   验证错误是'spree_social-3.1.0.beta包含自身   (spree_social-3.1.0.beta.gem),检查文件列表'

我尝试了删除Gemlock和更新宝石等所有内容。它不起作用。

以下是我的Gemfile

  source 'https://rubygems.org'

   ruby '2.3.0'
   # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
   gem 'rails', '4.2.5'
   # Use sqlite3 as the database for Active Record
   gem 'font-awesome-sass', '~> 4.5.0'
   # Use SCSS for stylesheets
   gem 'sass-rails', '~> 5.0'
   # Use Uglifier as compressor for JavaScript assets
   gem 'uglifier', '>= 1.3.0'
   # Use CoffeeScript for .coffee assets and views
   gem 'coffee-rails', '~> 4.1.0'
   # See https://github.com/rails/execjs#readme for more supported runtimes
   # gem 'therubyracer', platforms: :ruby
   gem 'roo-xls'
   # Use jquery as the JavaScript library
   gem 'jquery-rails'
   # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
   gem 'turbolinks'
   # Build JSON APIs with ease. Read more:         https://github.com/rails/jbuilder
   gem 'jbuilder', '~> 2.0'
   # bundle exec rake doc:rails generates the API under doc/api.
   gem 'sdoc', '~> 0.4.0', group: :doc
   gem 'aws-sdk', '< 2.0'
   # Use ActiveModel has_secure_password
   # gem 'bcrypt', '~> 3.1.7'
   gem 'paperclip'
   # Use Unicorn as the app server
   # gem 'unicorn'
   gem 'rails_12factor', group: :production
   # Use Capistrano for deployment
   # gem 'capistrano-rails', group: :development

   group :development, :test do
   # Call 'byebug' anywhere in the code to stop execution and get a  debugger console
   gem 'byebug'
   gem 'sqlite3'
   end

  group :production do
  # Call 'byebug' anywhere in the code to stop execution and get a  debugger console
  gem 'pg'
 end

  group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
   gem 'web-console', '~> 2.0'
   gem 'spree_scaffold', github: 'freego/spree_scaffold'

 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end


  gem 'spree', '3.0.5'
  gem 'spree_gateway', github: 'spree/spree_gateway', branch: '3-0-stable'
  gem 'spree_wishlist' , :path => File.join(File.dirname(__FILE__), '/vendor/gems/spree_wishlist-2.2.0')
 gem 'spree_social',  :path => File.join(File.dirname(__FILE__), '/vendor/gems/spree_social')
 gem 'spree_gift_card',  :path => File.join(File.dirname(__FILE__), '/vendor/gems/spree_gift_card')
  gem 'stringex'
  gem 'spree_reviews',  :path => File.join(File.dirname(__FILE__), '/vendor/gems/spree_reviews')
  gem 'spree_auth_devise',  :path => File.join(File.dirname(__FILE__), '/vendor/gems/spree_auth_devise-3.0.6')
  gem 'spree_mail_settings',  :path => File.join(File.dirname(__FILE__), '/vendor/gems/spree_mail_settings')
  gem 'spree_mail_settings', github: 'spree-contrib/spree_mail_settings', branch: 'master'

其他人面临这个问题?

由于

1 个答案:

答案 0 :(得分:0)

这很可能是因为已编译的.gem文件包含在存储库中。我认为这是因为gem试图将spree_social-3.1.0.beta.gem文件打包在其内部,并且它不是这样。尝试从存储库中删除.gem文件,然后重新运行软件包安装。

我敢打赌File.join(File.dirname(__FILE__), '/vendor/gems/spree_social'指向一个git存储库,bundle install将在每次尝试运行它时编译并安装gem。我的理解是,以这种方式编译gem时,它在git存储库上运行git ls-files -z`.split("\x0")以获得要放入gem的文件列表。由于.gem文件出现在结果中,因此它将尝试将其编译为gem,从而导致其失败。

我今天遇到了这个问题,我的Gemfile正在从我发布到Github的存储库中提取一个gem,bundle install一直失败,直到我从存储库中删除了.gem文件。