[英]I can't do “git push heroku master”
当我点击git push heroku master
时,我收到错误。
remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
remote: !
remote: ! Precompiling assets failed.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to xxx
remote:
To https://git.heroku.com/xxx.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/xxx.git'
我的宝石文件如下。
source 'https://rubygems.org'
ruby '2.3.0'
gem 'rails_12factor', group: :production
gem 'bootstrap-sass'
gem 'rails', '4.2.5.1'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :production, :staging do
gem 'unicorn'
end
group :development, :test do
gem 'capistrano'
gem 'capistrano-bundler'
gem 'capistrano-rails'
gem 'capistrano-rbenv'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
group :development, :test do
gem 'sqlite3'
end
group :development, :test do
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
我不知道为什么我被拒绝将我的rails应用程序推送到heroku。 我觉得我的Gemfile没问题。 如果有人知道解决方案。 我真的很感激。
该错误表示存在比本地提交更新的更改。
要解决这个问题:
我将添加Heiu Pham的答案,并说在Heroku中,你可能会遇到推向主分支的问题(例如,如果你在历史上落后了)。 你可以做的是使用开始一个新的分支
git checkout -b tempbranch然后推送使用
git push heroku tempbranch
如果您完全确定没有新的参考,您可以尝试
git push heroku -f
如果这仍然不起作用,请检查$ heroku logs
以获得问题的提示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.