Question

Yesterday I had an unexpected outage when i was trying to bundle install the spree_i18n (2-1-stable). Now I´m trying again and I´m getting this error:

Fetching git://github.com/spree/spree_i18n.git
remote: Reusing existing pack: 5457, done.
remote: Counting objects: 1, done.
remote: Total 5458 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (5458/5458), 5.43 MiB | 1.12 MiB/s, done.
Resolving deltas: 100% (2586/2586), done.
fatal: index file smaller than expected
Retrying git fetch --force --quiet --tags "/usr/local/rvm/gems/ruby-2.1.0/cache/bundler/git/spree_i18n-9ca2061df39e8ec5a8680e02b37a93a3750bd57c" due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/usr/local/rvm/gems/ruby-2.1.0/cache/bundler/git/spree_i18n-9ca2061df39e8ec5a8680e02b37a93a3750bd57c"` in directory /usr/local/rvm/gems/ruby-2.1.0/bundler/gems/spree_i18n-a2c64740cdc7 has failed.
If this error persists you could try removing the cache directory '/usr/local/rvm/gems/ruby-2.1.0/cache/bundler/git/spree_i18n-9ca2061df39e8ec5a8680e02b37a93a3750bd57c'
fatal: index file smaller than expected
Retrying git fetch --force --quiet --tags "/usr/local/rvm/gems/ruby-2.1.0/cache/bundler/git/spree_i18n-9ca2061df39e8ec5a8680e02b37a93a3750bd57c" due to error (3/3): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/usr/local/rvm/gems/ruby-2.1.0/cache/bundler/git/spree_i18n-9ca2061df39e8ec5a8680e02b37a93a3750bd57c"` in directory /usr/local/rvm/gems/ruby-2.1.0/bundler/gems/spree_i18n-a2c64740cdc7 has failed.
If this error persists you could try removing the cache directory '/usr/local/rvm/gems/ruby-2.1.0/cache/bundler/git/spree_i18n-9ca2061df39e8ec5a8680e02b37a93a3750bd57c'
fatal: index file smaller than expected
Git error: command `git fetch --force --quiet --tags
"/usr/local/rvm/gems/ruby-2.1.0/cache/bundler/git/spree_i18n-9ca2061df39e8ec5a8680e02b37a93a3750bd57c"` in directory
/usr/local/rvm/gems/ruby-2.1.0/bundler/gems/spree_i18n-a2c64740cdc7 has failed.
If this error persists you could try removing the cache directory
'/usr/local/rvm/gems/ruby-2.1.0/cache/bundler/git/spree_i18n-9ca2061df39e8ec5a8680e02b37a93a3750bd57c'

I tried removing the directory specified on the error, but same result.

My Gemfile looks like this:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'

# Use sqlite3 as the database for Active Record
gem 'sqlite3'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
#gem 'jquery-rails'
gem 'jquery-rails', '~> 3.0.0'

# 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', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

# Spree
gem 'spree', github: 'spree/spree', branch: '2-1-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-1-stable'
gem 'spree_paypal_express', :github => "radar/better_spree_paypal_express", :branch => "2-1-stable"
gem 'spree_fancy', :github => "spree/spree_fancy", :branch => "2-1-stable"
gem 'spree_reviews', github: 'spree/spree_reviews', branch: '2-1-stable'
gem 'spree_wishlist', :git => 'git://github.com/spree/spree_wishlist.git', :branch => "2-1-stable"
gem 'spree_email_to_friend', :git => 'git://github.com/spree/spree_email_to_friend.git', :branch => "2-1-stable"
gem 'deface', github: 'spree/deface'
gem 'spree_i18n', github: 'spree/spree_i18n', branch: '2-1-stable'

Any idea how to solve this?

Was it helpful?

Solution

Ok I solved the issue. I write the workaround just for information if someone gets into the same problem.

I went to my directory gems under bundler on my ruby version and found out that 4 different directories were created for spree_i18n. I just changed the name of all of them and try again the bundle install from my app directory. Now everything worked properly and the module is added to the bundle.

guillermo@willylaptop:/usr/local/rvm/gems/ruby-2.1.0/bundler/gems$ ll
total 88
drwxrwsr-x 22 guillermo rvm 4096 Feb  6 14:08 ./
drwxrwsr-x  3 guillermo rvm 4096 Jan 27 18:42 ../
drwxrwxr-x  9 guillermo rvm 4096 Feb  8 17:06 better_spree_paypal_express-f385bbe229c9/
drwxrwxr-x  7 guillermo rvm 4096 Feb  8 17:06 deface-607524622705/
drwxrwxr-x  9 guillermo rvm 4096 Feb  8 17:06 spree_auth_devise-f6f91480655b/
drwxrwxr-x 10 guillermo rvm 4096 Feb  8 17:06 spree-b328e2487bfc/
drwxrwxr-x  8 guillermo rvm 4096 Feb  8 17:06 spree_email_to_friend-f6483b4d8dba/
drwxrwxr-x 10 guillermo rvm 4096 Feb  8 17:06 spree_fancy-d6b6cf03b1f6/
drwxrwxr-x 10 guillermo rvm 4096 Jan 30 14:41 spree-ffda7917903a/
drwxrwxr-x  9 guillermo rvm 4096 Jan 30 14:41 spree_gateway-04c51e6bd24e/
drwxrwxr-x  9 guillermo rvm 4096 Jan 31 09:48 spree_gateway-ab4dcb885418/
drwxrwxr-x 10 guillermo rvm 4096 Jan 30 14:09 spree_i18n-2398a7064abe/
drwxrwxr-x 10 guillermo rvm 4096 Jan 31 09:48 spree_i18n-7b1061b06199/
drwxrwxr-x 10 guillermo rvm 4096 Feb  6 14:08 spree_i18n-a2c64740cdc7/
drwxrwxr-x 10 guillermo rvm 4096 Jan 27 20:01 spree_i18n-a5ab8c91b4dd/
drwxrwxr-x  9 guillermo rvm 4096 Jan 29 14:48 spree-product-assembly-30c8ea090e4a/
drwxrwxr-x  9 guillermo rvm 4096 Jan 31 09:48 spree-product-assembly-586ba3923b64/
drwxrwxr-x  9 guillermo rvm 4096 Jan 29 13:27 spree-product-assembly-85cecdfc828d/
drwxrwxr-x 10 guillermo rvm 4096 Feb  8 17:06 spree_reviews-30c7518d65e4/
drwxrwxr-x  8 guillermo rvm 4096 Jan 31 09:48 spree_static_content-5966c16c9ef1/
drwxrwxr-x  8 guillermo rvm 4096 Jan 30 14:05 spree_static_content-6ac885b6f8c2/
drwxrwxr-x  8 guillermo rvm 4096 Feb  8 17:06 spree_wishlist-56f1f230b0bc/
guillermo@willylaptop:/usr/local/rvm/gems/ruby-2.1.0/bundler/gems$ mv spree_i18n-2398a7064abe/ spree_i18n-2398a7064abe.bck
guillermo@willylaptop:/usr/local/rvm/gems/ruby-2.1.0/bundler/gems$ mv spree_i18n-7b1061b06199/ spree_i18n-7b1061b06199.bck
guillermo@willylaptop:/usr/local/rvm/gems/ruby-2.1.0/bundler/gems$ mv spree_i18n-a2c64740cdc7/ spree_i18n-a2c64740cdc7.bck
guillermo@willylaptop:/usr/local/rvm/gems/ruby-2.1.0/bundler/gems$ mv spree_i18n-a5ab8c91b4dd/ spree_i18n-a5ab8c91b4dd-bck

OTHER TIPS

This is a git error I've also got in the past and I've solved it by removing the .git/index and then reset to HEAD.
You can find more details here:
http://programertools.blogspot.com/2014/04/how-to-fix-fatal-index-file-smaller.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top