В последнее время я обновил приложение для рельсов от Rails 3 до Rails 5 и от Bootstrap 2 до Bootstrap 4, и после решения проблемы у меня возникли проблемы с загрузкой его в Heroku. Я имею в виду, что в локальном режиме он отлично работает с rails server
. Но когда я попытался загрузить его, я получаю сообщение об ошибке, и я не могу найти какой-либо подобный случай в Интернете. Это то, что я получаю после 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:
Я знаю, что он жалуется на мою версию пакета, но это должно быть предупреждение, а не реальная ошибка. Я предполагаю, что проблема должна быть в одном из камней, которые могут быть несовместимы с Heroku или Rails 5, но они не создают проблем на локальном сервере. Вот мой 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'
Как один из ответов, я тоже пытался использовать git pull heroku master
и он возвращает:
From https://git.heroku.com/keepmefit
* branch master -> FETCH_HEAD
* [new branch] master -> heroku/master
Already up-to-date.
Также git push -f heroku master
и выход такой же, как с помощью git push heroku master
поэтому ошибка все еще существует, и нажатие отклоняется.
Любая помощь приветствуется.
Кажется, что стек (кедр-14 или кедр) действительно старый. Модернизация стека до Heroku-16 решит проблему.
Похоже, что вы, удаленный герой, сталкиваетесь с файлами, которые вы пытаетесь нажать (после вашего обновления). У вас есть два варианта
1 - Очистите/объедините свои новые изменения с помощью пульта герою и нажмите снова
git pull heroku master
git push heroku master
2 - Принудительное изменение ваших новых изменений
ПРИМЕЧАНИЕ: ЭТО ДЕЙСТВИЕ НАПРАВЛЯЕТ, ЧТО ВЫ НАХОДИТЕСЬ В ГЕРОКУ. Поэтому убедитесь, что вам не нужны какие-либо изменения, которые уже есть на герою.
git push -f heroku master