【问题标题】:heroku push rejected, failed to compile Ruby appheroku push 被拒绝,无法编译 Ruby 应用程序
【发布时间】:2014-06-07 19:54:19
【问题描述】:

当我运行命令“git push -f heroku”时,我遇到了以下问题:

获取存储库,完成。 计数对象:55,完成。 Delta 压缩最多使用 4 个线程。 压缩对象:100% (30/30),完成。 写入对象:100% (35/35),9.26 KiB | 0 字节/秒,完成。 总共 35 个(增量 20),重复使用 14 个(增量 2)

-----> 删除 .DS_Store 文件

-----> 检测到 Ruby 应用程序

-----> 编译 Ruby/Rails

-----> 使用 Ruby 版本:ruby-2.0.0

-----> 使用 1.5.2 安装依赖项

   Ruby version change detected. Clearing bundler cache.
   Old: ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
   New: ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-linux]
   Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
   You are trying to install in deployment mode after changing
   your Gemfile. Run `bundle install` elsewhere and add the
   updated Gemfile.lock to version control.
   You have deleted from the Gemfile:
   * geocoder
   Bundler Output: You are trying to install in deployment mode after changing
   your Gemfile. Run `bundle install` elsewhere and add the
   updated Gemfile.lock to version control.

   You have deleted from the Gemfile:
   * geocoder

! !无法通过 Bundler 安装 gem。 !

! Push 被拒绝,无法编译 Ruby 应用

致 git@heroku.com:tummystuffer.git ! [remote denied] master -> master (pre-receive hook denied) 错误:未能将一些引用推送到 'git@heroku.com:tummystuffer.git'

所以我在我的 Gemfile 中添加了 gem 'geocoder',删除了 Gemfile.lock,运行了“bundle install”、“git add”、“git commit”,然后再次推送,但得到了完全相同的错误。

我试图从这个heroku push rejected, failed to compile Ruby/rails app 解决问题,但仍然给了我同样的错误。

我已经运行了“gem cleanup”并运行了“gem update”,但没有成功。

这是我的 Gemfile:

source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.0'

# Rails defaults
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'

# rails-bootstrap
gem 'activerecord-tableless'
gem 'bootstrap-sass'
gem 'figaro'
gem 'google_drive'
gem 'high_voltage'
gem 'simple_form', '>= 3.0.0.rc'
group :development, :test do
gem 'sqlite3'
gem 'better_errors'
gem 'quiet_assets'
end
group :production do
gem 'pg'
gem 'thin'
gem 'rails_on_heroku'
end
gem 'therubyracer'
gem 'less-rails'
gem 'twitter-bootstrap-rails'
gem 'mail'
gem 'oauth2'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
gem 'best_in_place'
gem "font-awesome-rails"
gem 'geocoder'

编辑:

这是我的 Gemfile.lock:

GEM
remote: https://rubygems.org/
specs:
actionmailer (4.1.0)
actionpack (= 4.1.0)
actionview (= 4.1.0)
mail (~> 2.5.4)
actionpack (4.1.0)
actionview (= 4.1.0)
activesupport (= 4.1.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
actionview (4.1.0)
activesupport (= 4.1.0)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.0)
activesupport (= 4.1.0)
builder (~> 3.1)
activerecord (4.1.0)
activemodel (= 4.1.0)
activesupport (= 4.1.0)
arel (~> 5.0.0)
activerecord-tableless (1.3.3)
activerecord (>= 2.3.0)
activesupport (4.1.0)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
arel (5.0.1.20140414130214)
best_in_place (0.2.3)
rails (>= 3.0.0)
better_errors (1.1.0)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
bootstrap-sass (3.1.1.1)
sass (~> 3.2)
builder (3.2.2)
coderay (1.1.0)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.7.0)
commonjs (0.2.7)
daemons (1.1.9)
erubis (2.7.0)
eventmachine (1.0.3)
execjs (2.0.2)
faraday (0.9.0)
multipart-post (>= 1.2, < 3)
figaro (0.7.0)
bundler (~> 1.0)
rails (>= 3, < 5)
font-awesome-rails (4.0.3.1)
railties (>= 3.2, < 5.0)
geocoder (1.2.0)
google_drive (0.3.9)
nokogiri (>= 1.4.4, != 1.5.2, != 1.5.1)
oauth (>= 0.3.6)
oauth2 (>= 0.5.0)
hashie (2.1.1)
high_voltage (2.1.0)
hike (1.2.3)
i18n (0.6.9)
jbuilder (2.0.6)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
jwt (0.1.11)
multi_json (>= 1.5)
less (2.5.0)
commonjs (~> 0.2.7)
less-rails (2.5.0)
actionpack (>= 3.1)
less (~> 2.5.0)
libv8 (3.16.14.3)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
mini_portile (0.5.3)
minitest (5.3.3)
multi_json (1.9.2)
multi_xml (0.5.5)
multipart-post (2.0.0)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
oauth (0.4.7)
oauth2 (0.9.3)
faraday (>= 0.8, < 0.10)
jwt (~> 0.1.8)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (~> 1.2)
omniauth (1.2.1)
hashie (>= 1.2, < 3)
rack (~> 1.0)
omniauth-facebook (1.6.0)
omniauth-oauth2 (~> 1.1)
omniauth-oauth (1.0.1)
oauth
omniauth (~> 1.0)
omniauth-oauth2 (1.1.2)
faraday (>= 0.8, < 0.10)
multi_json (~> 1.3)
oauth2 (~> 0.9.3)
omniauth (~> 1.2)
omniauth-twitter (1.0.1)
multi_json (~> 1.3)
omniauth-oauth (~> 1.0)
pg (0.17.1)
polyglot (0.3.4)
quiet_assets (1.0.2)
railties (>= 3.1, < 5.0)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.1.0)
actionmailer (= 4.1.0)
actionpack (= 4.1.0)
actionview (= 4.1.0)
activemodel (= 4.1.0)
activerecord (= 4.1.0)
activesupport (= 4.1.0)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.0)
sprockets-rails (~> 2.0)
rails_on_heroku (0.0.2)
rails_serve_static_assets
rails_stdout_logging
rails_serve_static_assets (0.0.2)
rails_stdout_logging (0.0.3)
railties (4.1.0)
actionpack (= 4.1.0)
activesupport (= 4.1.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.3.1)
ref (1.0.5)
sass (3.2.19)
sass-rails (4.0.3)
railties (>= 4.0.0, < 5.0)
sass (~> 3.2.0)
sprockets (~> 2.8, <= 2.11.0)
sprockets-rails (~> 2.0)
simple_form (3.1.0.rc1)
actionpack (~> 4.0)
activemodel (~> 4.0)
sprockets (2.11.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.1.3)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
sqlite3 (1.3.9)
therubyracer (0.12.1)
libv8 (~> 3.16.14.0)
ref
thin (1.6.2)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
rack (>= 1.0.0)
thor (0.19.1)
thread_safe (0.3.3)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.2.2)
coffee-rails
twitter-bootstrap-rails (2.2.8)
actionpack (>= 3.1)
execjs
rails (>= 3.1)
railties (>= 3.1)
tzinfo (1.1.0)
thread_safe (~> 0.1)
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)

PLATFORMS
  ruby

DEPENDENCIES
activerecord-tableless
best_in_place
better_errors
bootstrap-sass
coffee-rails (>= 4.0.0)
figaro
font-awesome-rails
geocoder
google_drive
high_voltage
jbuilder (>= 1.2)
jquery-rails
less-rails
mail
oauth2
omniauth-facebook
omniauth-twitter
pg
quiet_assets
rails (>= 4.0.0)
rails_on_heroku
sass-rails (>= 4.0.0)
simple_form (>= 3.0.0.rc)
sqlite3
therubyracer
thin
turbolinks
twitter-bootstrap-rails
uglifier (>= 1.3.0)

任何帮助将不胜感激。

【问题讨论】:

  • 在推送到heroku之前运行bundle install
  • 你是否同时提交了 Gemfile 和 Gemfile.lock ?
  • 是的,我做到了。但仍然给我同样的错误。

标签: ruby-on-rails ruby ruby-on-rails-3 git heroku


【解决方案1】:

错误状态:

您尝试在更改 Gemfile 后以部署模式安装。在其他地方运行 bundle install 并添加更新的 Gemfile.lock 到版本控制。

这基本上意味着你要么没有提交你的Gemfile.lock,要么没有运行bundle install 命令,它基本上重建了Gemfile.lock。现在有一个冲突,您必须在您的开发环境中使用 bundle install 来解决:

$ bundle install
$ git add .
$ git commit -a -m "Geocoder"
$ git push -f heroku

【讨论】:

  • 我已经完成了所有这些,但仍然给我同样的错误。
  • 你能看看你的 Gemfile.lock 并告诉我里面有什么吗?它是否在任何地方提到了地理编码器?
  • 是的,我刚刚编辑了我的问题并将 Gemfile.lock 中的内容复制并粘贴到问题中。它在 Gemfile.lock 中提到了地理编码器。
  • 您可以从您的Gemfile.lock 中删除geocoder 并重试吗?
【解决方案2】:

我实际上能够解决这个问题。我发现我正试图将项目推送到另一个分支(而不是主分支)。我通过将分支与主分支合并并再次推送来解决了这个问题。

【讨论】:

    【解决方案3】:

    我遇到了同样的问题。一个简单的捆绑安装为我解决了这个问题。 在bundle installgit add .git commit 之后,我将代码推送给了heroku master,它成功了! $ git push -f heroku master

    【讨论】:

      【解决方案4】:

      这是一个旧线程但仍然相关......我通过这样做解决了这个问题:
      1)在终端创建一个新的分支修复

      git checkout -b fixes
      

      2) 删除 gemfile.lock
      3) 在 gemfile 中替换 gem 'squlite3' 和 gem 'pg' 这个

      group :development, :test do
        gem 'sqlite3'
      end
      
      group :production do
        gem 'pg', '0.20.0'
      end
      

      4) 在终端中运行这些命令

      bundle update
      bundle install --without production
      git add .
      git commit "Update files for heroku"
      git checkout master
      git merge fixes
      git push -f heroku master
      

      【讨论】:

        猜你喜欢
        • 2013-03-22
        • 2017-01-17
        • 2019-10-25
        • 2013-05-01
        • 1970-01-01
        • 1970-01-01
        • 2017-04-27
        • 2014-02-08
        • 2023-03-07
        相关资源
        最近更新 更多