【问题标题】:uploading to heroku causes an error上传到heroku会导致错误
【发布时间】:2013-12-27 08:17:32
【问题描述】:

每次我尝试使用 git push heroku master 将我的项目推送到 Heroku 时,我都会收到以下响应。我有一台 macbook air OSX-10.8。

    -----> Ruby app detected
    -----> Compiling Ruby/Rails
    -----> Using Ruby version: ruby-2.0.0
    -----> Installing dependencies using Bundler version 1.3.2
           New app detected loading default bundler cache
           Running: bundle install --without development:test --path vendor/bundle --binstubs  vendor/bundle/bin --deployment
           Fetching gem metadata from https://rubygems.org/..........
           Fetching gem metadata from https://rubygems.org/..
           Fetching git://github.com/thomas-mcdonald/bootstrap-sass.git
           fatal: Could not parse object '9c6c07f74ff515cf38380b014cfede14a4f0eae4'.
           Git error: command `git reset --hard 9c6c07f74ff515cf38380b014cfede14a4f0eae4`
           in directory
           /tmp/build_260d9aa7-1d8e-4738-b10f-    fce9113dd86e/vendor/bundle/ruby/2.0.0/bundler/gems/bootstrap-sass-9c6c07f74ff5
           has failed.
           If this error persists you could try removing the cache directory
           '/tmp/build_260d9aa7-1d8e-4738-b10f-fce9113dd86e/vendor/bundle/ruby/2.0.0/cache/bundler/git/bootstrap-sass-33efd1d8ffb6176fdb805029a30f02a6edfbae2e'
           Bundler Output: Fetching gem metadata from https://rubygems.org/..........
           Fetching gem metadata from https://rubygems.org/..
           Fetching git://github.com/thomas-mcdonald/bootstrap-sass.git
           fatal: Could not parse object '9c6c07f74ff515cf38380b014cfede14a4f0eae4'.
           Git error: command `git reset --hard 9c6c07f74ff515cf38380b014cfede14a4f0eae4`
           in directory
           /tmp/build_260d9aa7-1d8e-4738-b10f-fce9113dd86e/vendor/bundle/ruby/2.0.0/bundler/gems/bootstrap-sass-9c6c07f74ff5
       has failed.
       If this error persists you could try removing the cache directory
       '/tmp/build_260d9aa7-1d8e-4738-b10f-fce9113dd86e/vendor/bundle/ruby/2.0.0/cache/bundler/git/bootstrap-sass-33efd1d8ffb6176fdb805029a30f02a6edfbae2e'
 !
 !     Failed to install gems via Bundler.
 !

 !     Push rejected, failed to compile Ruby app

To git@heroku.com:fierce-taiga-8706.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:fierce-taiga-8706.git'

这是我的 git 遥控器

heroku  git@heroku.com:sheltered-crag-6550.git (fetch)
heroku  git@heroku.com:sheltered-crag-6550.git (push)
origin  git@github.com:TheM00se/Pinteresting.git (fetch)
origin  git@github.com:TheM00se/Pinteresting.git (push

这是我的 Gemfile

source 'https://rubygems.org'



gem 'rails', '4.0.1'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'bootstrap-sass', github: 'thomas-mcdonald/bootstrap-sass', branch: '3'

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

group :development, :test do
     gem 'sqlite3'
end

group :production do
     gem 'pg'
     gem 'rails_12factor'
end

我花了 2 个小时试图找出一个解决方案,但我什至不确定问题出在哪里。

【问题讨论】:

    标签: heroku-toolbelt


    【解决方案1】:

    问题在于:

    gem 'bootstrap-sass', github: 'thomas-mcdonald/bootstrap-sass', branch: '3'
    

    如果您检查以下链接:

    https://github.com/thomas-mcdonald/bootstrap-sass/branches

    该分支似乎已被删除,也许它已合并到主分支中,根据 OP 的反馈,任何使用它的人随后都应将以下内容添加到他们的 Gemfile:

    gem 'sass-rails', '>= 3.2' # sass-rails needs to be higher than 3.2
    gem 'bootstrap-sass', '~> 3.0.3.0'
    

    【讨论】:

    • 我用第二行替换了该行,并收到一条错误消息“在 git://github.com/thomas-mcdonald/ 中找不到 gem 'boostrap-sass (>= 0) ruby​​' bootstrap-sass.git(在 master)。源不包含任何版本的 'boostrap-sass (>= 0) ruby​​'"
    • 我遵循了 Thomas Mcdonald 制定的惯例,并且成功了。
    • 我为以后需要的人更新了答案
    • 非常感谢,虽然又是一个gem,但分支确实被删除了。
    猜你喜欢
    • 2018-10-23
    • 1970-01-01
    • 2019-11-08
    • 2017-06-21
    • 1970-01-01
    • 1970-01-01
    • 2015-11-29
    • 2020-07-16
    • 1970-01-01
    相关资源
    最近更新 更多