简体   繁体   English

Heroku Ruby on Rails应用程序推送失败

[英]Heroku Ruby on Rails app push failed

Lately I upgraded my rails app from Rails 3 to Rails 5 and from Bootstrap 2 to Bootstrap 4 and after solving it all I am having some trouble uploading it to Heroku. 最近,我将Rails应用程序从Rails 3升级到Rails 5,从Bootstrap 2升级到Bootstrap 4,解决了所有这些之后,我在将其上传到Heroku时遇到了一些麻烦。 I mean, in local it works perfectly with rails server . 我的意思是,在本地,它与rails server完美配合。 But when I have tried to upload it I get an error and I can't find any similar case on the Internet. 但是,当我尝试上传时,出现错误,并且在互联网上找不到任何类似的情况。 This is what I get after git push heroku master : 这是我在git push heroku master之后得到的:

Counting objects: 122, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (119/119), done.
Writing objects: 100% (122/122), 31.05 KiB | 1.48 MiB/s, done.
Total 122 (delta 77), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote:        Your app was upgraded to bundler 1.15.2.
remote:        Previously you had a successful deploy with bundler 1.5.2.
remote:
remote:        If you see problems related to the bundler version please refer to:
remote:        https://devcenter.heroku.com/articles/bundler-version
remote: -----> Using Ruby version: ruby-1.9.2
remote: ###### WARNING:
remote:        Removing `Gemfile.lock` because it was generated on Windows.
remote:        Bundler will do a full resolve so native gems are handled properly.
remote:        This may result in unexpected gem versions being used in your app.
remote:        In rare occasions Bundler may not be able to resolve your dependencies at all.
remote:        https://devcenter.heroku.com/articles/bundler-windows-gemfile
remote:
remote: -----> Installing dependencies using bundler 1.15.2
remote:        Purging Cache. Changing stack from cedar to cedar-14
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
remote:        Fetching gem metadata from https://rubygems.org/........
remote:        Fetching version metadata from https://rubygems.org/..
remote:        Fetching dependency metadata from https://rubygems.org/.
remote:        Resolving dependencies...
remote:        The latest bundler is 1.16.0, but you are currently running 1.15.2.
remote:        To update, run `gem install bundler`
remote:        Bundler could not find compatible versions for gem "rubygemsils (= 5.1.4) was resolved to 5.1.4, which depends on
remote:        rubygems       Bundler Output: Fetching gem metadata from https://rubygems.org/........
remote:        Fetching version metadata from https://rubygems.org/..
remote:        Fetching dependency metadata from https://rubygems.org/.
remote:        Resolving dependencies...
remote:        The latest bundler is 1.16.0, but you are currently running 1.15.2.
remote:        To update, run `gem install bundler`
remote:        Bundler could not find compatible versions for gem "rubygemsresolved to 5.1.4, which depends on
remote:        rubygems !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to keepmefit.
remote:

I know it complains about my bundler version but it should be a warning and not a real error. 我知道它抱怨我的捆绑软件版本,但这应该是警告,而不是真正的错误。 I guess the problem must be in one of the gems that may not be compatible with Heroku or Rails 5 now but they give no problem on local server. 我猜问题可能出在现在可能与Heroku或Rails 5不兼容的宝石之一中,但它们在本地服务器上没有问题。 Here's my Gemfile: 这是我的Gemfile:

source 'https://rubygems.org'

gem 'rails', '5.1.4'

if RUBY_VERSION =~ /1.9/
  Encoding.default_external = Encoding::UTF_8
  Encoding.default_internal = Encoding::UTF_8
end

group :development, :test do
    gem 'sqlite3'
  gem 'activemodel'
  gem 'json'

    gem 'rspec-rails'
    gem 'guard-rspec'
    gem 'rb-notifu'
end

# Heroku uses PostreSQL
group :production do
    gem 'pg'
end

group :test do 
    gem 'capybara'
    gem 'factory_girl_rails', '4.1.0'
    gem 'launchy'
end

group :development do
    gem 'annotate'
    gem 'better_errors'
    gem 'binding_of_caller'
    gem 'meta_request'
end


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails'
  gem 'coffee-rails'
    gem 'coffee-script-source', '1.8.0'

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'
# To use ActiveModel has_secure_password
#gem 'bcrypt-ruby'
gem 'bcrypt', '~> 3.1.11', platforms: [:ruby, :x64_mingw, :mingw]

# HTML abstraction language (Haml)
gem 'haml'
gem 'haml-rails'

# Twitter Bootstrap
gem 'bootstrap-sass'

require 'rbconfig'
gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i

# HMTL 5 support
gem 'modernizr-rails'

# More icons!
#gem "font-awesome-rails"

# http://rubydoc.info/gems/bootstrap-datepicker-rails/1.0.0.7/frames
gem 'bootstrap-datepicker-rails'
gem 'tzinfo-data'

# Sample data 
gem 'faker', '1.1.2'

# Pagination
gem 'will_paginate', '~> 3.1.0'
gem 'bootstrap-will_paginate'

# Turbolinks https://github.com/rails/turbolinks#turbolinks
# http://railscasts.com/episodes/390-turbolinks
gem 'turbolinks'
gem 'jquery-turbolinks'

# https://github.com/rails/strong_parameters
# gem 'strong_parameters'

# http://railscasts.com/episodes/314-pretty-urls-with-friendlyid?view=asciicast
gem 'friendly_id'

# http://railscasts.com/episodes/324-passing-data-to-javascript?view=asciicast
gem 'gon'

gem 'cloudinary'

As one of the answers point, I have tried too with git pull heroku master and it returns: 作为答案之一,我也尝试过使用git pull heroku master并返回:

From https://git.heroku.com/keepmefit
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> heroku/master
Already up-to-date.

Also git push -f heroku master and the output is the same as using git push heroku master so the error is still there and the push is rejected. 此外, git push -f heroku master和输出与使用git push heroku master相同,因此错误仍然存​​在,并且推送被拒绝。

Any help is appreciated. 任何帮助表示赞赏。

It looks like you heroku remote is conflicting with the files you are trying to push (after your upgrade). 看来您的heroku遥控器与您尝试推送的文件(升级后)冲突。 You have two options 你有两个选择

1 - Clean / merge up with your new changes the heroku remote and push again 1-清理/合并您的新更改heroku遥控器,然后再次推送

  • git pull heroku master
  • Fix any conflicts / clean up etc.. 修复任何冲突/清理等。
  • git push heroku master

2 - Force push your new changes 2-强制推动您的新更改

NOTE: THIS ACTION WILL OVERRIDE WHAT YOU CURRENTLY HAVE IN HEROKU. 注意:此操作将覆盖您当前在HEROKU中所做的所有操作。 So make sure that you dont need any changes that are already on heroku. 因此,请确保您不需要任何已在heroku上进行的更改。

  • git push -f heroku master

It seems that the stack (cedar-14 or cedar) is a really old one. 堆栈(cedar-14或cedar)似乎是一个非常老的堆栈。 Upgrading the stack to Heroku-16 will solve the issue. 将堆栈升级到Heroku-16将解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM