简体   繁体   中英

bundle install gemspec error spree_social.gemspec

In my app when I am running bundle install , I am getting below error.

vendor/gems/spree_social/spree_social.gemspec is not valid. Please fix this gemspec. The validation error was 'spree_social-3.1.0.beta contains itself (spree_social-3.1.0.beta.gem), check your files list'

I tried everything like removing the Gemlock and updating the gems. It didn't work.

Below is my 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'

Anyone else faced this?

Thanks

This is most likely because your compiled .gem file is contained in the repository. I assume that this is because the gem is trying to package the spree_social-3.1.0.beta.gem file inside itself, and it doesn't like that. Try removing the .gem file from the repository and rerunning bundle install.

I am willing to bet that File.join(File.dirname(__FILE__), '/vendor/gems/spree_social' points to a git repository, where bundle install will compile and install the gem each time you try to run it. My understanding is that when the gem is compiled in this way, it runs git ls-files -z`.split("\\x0") on the git repository to get the list of files to put in the gem. Since the .gem file appears in the results, it tries to compile it into the gem, which causes it to fail.

I ran into this issue today, where my Gemfile was pulling a gem from a repository I published to Github, and bundle install kept failing until I removed the .gem file from the repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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