捆绑安装时Rails 4.0.2 spree_i18n错误

时间:2014-02-07 12:07:43

标签: ruby-on-rails ruby ruby-on-rails-4 spree

昨天当我试图捆绑安装spree_i18n(2-1-stable)时,我发生了意想不到的中断。 现在我再次尝试,我收到了这个错误:

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'

我尝试删除错误上指定的目录,但结果相同。

My Gemfile如下所示:

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'

知道如何解决这个问题吗?

2 个答案:

答案 0 :(得分:0)

好的,我解决了这个问题。如果有人遇到同样的问题,我会写这个解决方法只是为了获取信息。

我在我的ruby版本的bundler下找到了我的目录gems,发现为spree_i18n创建了4个不同的目录。我只是更改了所有这些名称,然后再次尝试从我的app目录中安装捆绑包。现在一切正常,模块已添加到捆绑包中。

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

答案 1 :(得分:0)

这是我过去也遇到的一个git错误,我通过删除.git/index然后重置为HEAD来解决它。
您可以在此处找到更多详细信息:
http://programertools.blogspot.com/2014/04/how-to-fix-fatal-index-file-smaller.html