无法通过Bundler安装gem。 远程:! 遥控器:遥控器:! 推送拒绝,无法编译Ruby app remote:

我正在使用一个应用程序,并希望在heroku上部署它,但我收到一些错误消息,并在heroku上构建失败。

下面是我的gemfile

source 'https://rubygems.org' gem 'rails', '4.2.2' gem 'sass-rails', '5.0.2' gem 'uglifier', '2.5.3' gem 'coffee-rails', '4.1.0' gem 'jquery-rails', '4.0.3' gem 'turbolinks', '2.3.0' gem 'jbuilder', '2.2.3' gem 'sdoc', '0.4.0', group: :doc group :development, :test do gem 'sqlite3', '1.3.9' gem 'byebug', '3.4.0' gem 'web-console', '2.0.0.beta3' gem 'spring', '1.1.3' end group :production do gem 'pg', '0.17.1' gem 'rails_12factor', '0.0.2' end 

和Gemfile.lock

 GEM remote: https://rubygems.org/ specs: actionmailer (4.2.2) actionpack (= 4.2.2) actionview (= 4.2.2) activejob (= 4.2.2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) actionpack (4.2.2) actionview (= 4.2.2) activesupport (= 4.2.2) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.1) actionview (4.2.2) activesupport (= 4.2.2) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.1) activejob (4.2.2) activesupport (= 4.2.2) globalid (>= 0.3.0) activemodel (4.2.2) activesupport (= 4.2.2) builder (~> 3.1) activerecord (4.2.2) activemodel (= 4.2.2) activesupport (= 4.2.2) arel (~> 6.0) activesupport (4.2.2) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) arel (6.0.0) binding_of_caller (0.7.3.pre1) debug_inspector (>= 0.0.1) builder (3.2.2) byebug (3.4.0) columnize (~> 0.8) debugger-linecache (~> 1.2) slop (~> 3.6) coffee-rails (4.1.0) coffee-script (>= 2.2.0) railties (>= 4.0.0, = 4.1.0) i18n (0.7.0) jbuilder (2.2.3) activesupport (>= 3.0.0,  1.2) jquery-rails (4.0.3) rails-dom-testing (~> 1.0) railties (>= 4.2.0) thor (>= 0.14, = 1.5.9) mail (2.6.3) mime-types (>= 1.16,  0.6.0) pg (0.17.1) rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) rails (4.2.2) actionmailer (= 4.2.2) actionpack (= 4.2.2) actionview (= 4.2.2) activejob (= 4.2.2) activemodel (= 4.2.2) activerecord (= 4.2.2) activesupport (= 4.2.2) bundler (>= 1.3.0, = 4.2.0.alpha) rails-dom-testing (1.0.6) activesupport (>= 4.2.0.beta,  1.6.0) rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.2) loofah (~> 2.0) rails_12factor (0.0.2) rails_serve_static_assets rails_stdout_logging rails_serve_static_assets (0.0.4) rails_stdout_logging (0.0.3) railties (4.2.2) actionpack (= 4.2.2) activesupport (= 4.2.2) rake (>= 0.8.7) thor (>= 0.18.1, = 4.0.0,  3.1) sprockets (>= 2.8, = 2.0,  1.1) sdoc (0.4.0) json (~> 1.8) rdoc (~> 4.0,  1.0) sprockets-rails (2.3.2) actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8,  0.1) uglifier (2.5.3) execjs (>= 0.3.0) json (>= 1.8.0) web-console (2.0.0.beta3) activemodel (~> 4.0) binding_of_caller (= 0.7.3.pre1) railties (~> 4.0) sprockets-rails (>= 2.0, < 4.0) PLATFORMS ruby DEPENDENCIES byebug (= 3.4.0) coffee-rails (= 4.1.0) jbuilder (= 2.2.3) jquery-rails (= 4.0.3) pg (= 0.17.1) rails (= 4.2.2) rails_12factor (= 0.0.2) sass-rails (= 5.0.2) sdoc (= 0.4.0) spring (= 1.1.3) sqlite3 (= 1.3.9) turbolinks (= 2.3.0) uglifier (= 2.5.3) web-console (= 2.0.0.beta3) 

以下是我在终端上运行git push heroku master后的输出屏幕消息列表。

 . . remote: You have added to the Gemfile: remote: * rails (= 4.2.2) remote: * sass-rails (= 5.0.2) remote: * uglifier (= 2.5.3) remote: * coffee-rails (= 4.1.0) remote: * jquery-rails (= 4.0.3) remote: * turbolinks (= 2.3.0) remote: * jbuilder (= 2.2.3) remote: * sdoc (= 0.4.0) remote: * sqlite3 (= 1.3.9) remote: * byebug (= 3.4.0) remote: * web-console (= 2.0.0.beta3) remote: * spring (= 1.1.3) remote: * pg (= 0.17.1) remote: * rails_12factor (= 0.0.2) remote: remote: You have deleted from the Gemfile: remote: * byebug remote: * coffee-rails (~> 4.1.0) remote: * jbuilder (~> 2.0) remote: * jquery-rails remote: * rails (= 4.2.0) remote: * sass-rails (~> 5.0) remote: * sdoc (~> 0.4.0) remote: * spring remote: * sqlite3 remote: * turbolinks remote: * uglifier (>= 1.3.0) remote: * web-console (~> 2.0) remote: ! remote: ! Failed to install gems via Bundler. remote: ! remote: remote: ! Push rejected, failed to compile Ruby app remote: remote: Verifying deploy... remote: remote: ! Push rejected to cryptic-ravine-9920. remote: To https://git.heroku.com/cryptic-ravine-9920.git ! [remote rejected] master -> master (pre-receive hook declined) 

有人可以看看吗?

这不仅仅意味着heroku中的Gemfile / Gemfile.lock不同步吗? 如果bundle install修改了Gemfile.lock,你应该提交它然后推送到heroku。

另一个问题可能是捆绑太旧了。 gem update bundler ; bundle install 如果这是一个问题, gem update bundler ; bundle install会解决这个问题。