3

我目前无法运行bundle install。它总是失败:

$ bundle install
Fetching source index from https://rubygems.org/
Updating git://github.com/gregbell/active_admin.git
fatal: Could not parse object 'a9949c1524205928b18597f840e83478ba97c2ef'.
Git error: command `git reset --hard a9949c1524205928b18597f840e83478ba97c2ef` in directory /Users/noxoc/.rvm/gems/ruby-1.9.3-p385@tp-usevalue/bundler/gems/active_admin-a9949c152420 has failed.
If this error persists you could try removing the cache directory '/Users/noxoc/.rvm/gems/ruby-1.9.3-p385@tp-usevalue/cache/bundler/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca'

我已经尝试按照建议删除缓存目录。这是我的 Gemfile(已排序,已删除评论):

source 'https://rubygems.org'

gem 'active_link_to'
gem 'activeadmin'
gem 'coffee-rails'
gem 'compass-rails'
gem 'debugger', group: [:development, :test]
gem 'devise',              github: 'plataformatec/devise'
gem 'formtastic',          github: 'justinfrench/formtastic'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'jbuilder', '~> 1.2'
gem 'jquery-rails'
gem 'jquery-turbolinks'
gem 'rails'
gem 'rails-i18n', '~> 4.0.0.pre' # For 4.0.x
gem 'ransack'
gem 'responders',          github: 'plataformatec/responders'
gem 'sass-rails'
gem 'simple_form'
gem 'sqlite3'
gem 'turbolinks'
gem 'uglifier', '>= 1.3.0'

group :doc do
  gem 'sdoc', require: false
end

group :development, :test do
  gem "rb-fsevent", "~> 0.9.1"
  gem "guard", "1.6.2"
  gem "guard-spork"
  gem "guard-rspec", "2.5.1"
  gem "rspec-rails", "2.13.1"
  gem "shoulda-matchers", "2.1.0"
  gem "capybara", "2.1.0"
  gem "launchy", "2.2.0"
  gem 'spork-rails', :github => 'sporkrb/spork-rails'
  gem "thin"
end

真正让我感到困惑的是,几天前它工作得很好。

更新

正如 zrl3dx 建议的那样,我删除了Gemfile.lockbundle再次运行 - 这导致了这个错误:

$ bundle
Updating git://github.com/gregbell/active_admin.git
Updating git://github.com/milgner/compass-rails.git
Updating git://github.com/plataformatec/devise.git
Updating git://github.com/justinfrench/formtastic.git
Updating git://github.com/josevalim/inherited_resources.git
Updating git://github.com/ernie/ransack.git
Updating git://github.com/plataformatec/responders.git
Updating git://github.com/sporkrb/spork-rails.git
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "ransack":
  In Gemfile:
    activeadmin (>= 0) ruby depends on
      ransack (>= 1.0.0) ruby

    ransack (0.7.3)

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    rails (= 4.0.0) ruby depends on
      railties (= 4.0.0) ruby

    coffee-rails (~> 4.0.0) ruby depends on
      railties (4.0.0.rc2)
4

3 回答 3

3

尝试删除Gemfile.lockbundle再次执行。

尝试添加到 Gemfile:

gem 'coffee-rails', git: 'git://github.com/rails/coffee-rails.git'

代替:

gem 'coffe-rails'

编辑:

好的,我已将其复制到本地并尝试解决,我的更改:

gem 'coffee-rails', git: 'git://github.com/rails/coffee-rails.git'
gem 'activeadmin',         github: 'gregbell/active_admin', branch: 'rails4'
gem 'rails', git: 'https://github.com/rails/rails.git', branch: '4-0-stable'
gem 'devise'
gem 'ransack'
gem 'sass-rails', git: 'https://github.com/rails/sass-rails.git'

现在它检查出来了,至少在这里。

于 2013-08-13T14:52:08.423 回答
2

已接受答案中引用的 Active Admin 的 rails4 分支不再存在。它已合并到 master 中,但尚未在 ruby​​gems 上发布。此 gemfile 条目将引用具有 rails4 支持的最新提交。

gem 'activeadmin', github: 'gregbell/active_admin', :ref=> 'fe7d6a6e1bafc9e9dd765dfb3a09245ccd0b3cfd'
于 2013-10-15T14:23:05.087 回答
0

如果发现这对我有用:

unset GIT_DIR

https://github.com/mislav/git-deploy/issues/27找到

于 2013-11-07T01:36:38.170 回答