У меня проблема, которую я видел у других и перепробовал множество предлагаемых решений, но ничего не работает.При попытке развернуть приложение rails в Heroku и добраться до точки, где мне нужно heroku rake db:migrate
, я получаю сообщение об ошибке You must use Bundler 2 or greater with this lockfile.
. Сначала я запускал Ruby 2.6.0, но после обновления до 2.6.1Читая некоторые посты, это было исправлено.Запуск Rails 5.2.2.
Я пытался:
- удалить файл блокировки и установить пакет
- сборщик обновлений gem (до 2.0)
- установить комплект --system
- heroku buildpacks: set
- сборщик пакетов gem -
- попытался удалить мое приложение Rails на Heroku и сбросить репозиторий Heroku и начал с
- попробовал
heroku rake:detach rake db:migrate
или что-то в этом роде.Это позволило выполнить миграцию, но затем я получил ошибки, и динамометрическая система потерпела крах. - попытался создать Procfile.dev с помощью команд
web: bundle exec bin/rails server -p $PORT -e $RAILS_ENV
worker: bundle exec sidekiq -C config/sidekiq.yml
Вот некоторые фрагменты кода, которые могут пролить свет на мою ситуацию.
мой Gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.2'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
gem 'active_model_serializers'
gem 'httparty'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
gem 'jwt-auth', '~> 3.0'
# gem 'dotenv-rails', groups: [:development, :test]
gem "figaro"
gem "aws-sdk-s3", require: false
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
gem 'rack-cors'
gem 'rename'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'listen', '>= 3.0.5', '< 3.2'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
мой лог-файл, когда я пытаюсь heroku open
:
2019-05-20T19:18:37.154031+00:00 app[api]: Release v2 created by user demiansims@gmail.com
2019-05-20T19:18:37.154031+00:00 app[api]: Enable Logplex by user demiansims@gmail.com
2019-05-20T19:18:36.926353+00:00 app[api]: Release v1 created by user demiansims@gmail.com
2019-05-20T19:18:36.926353+00:00 app[api]: Initial release by user demiansims@gmail.com
2019-05-20T19:19:02.000000+00:00 app[api]: Build started by user demiansims@gmail.com
2019-05-20T19:19:52.512189+00:00 app[api]: Set LANG, RACK_ENV, RAILS_ENV, RAILS_LOG_TO_STDOUT, RAILS_SERVE_STATIC_FILES, SECRET_KEY_BASE config vars by user demiansims@gmail.com
2019-05-20T19:19:52.512189+00:00 app[api]: Release v3 created by user demiansims@gmail.com
2019-05-20T19:19:53.944345+00:00 app[api]: Deploy 3ab64d18 by user demiansims@gmail.com
2019-05-20T19:19:53.944345+00:00 app[api]: Release v6 created by user demiansims@gmail.com
2019-05-20T19:19:53.957391+00:00 app[api]: Scaled to console@0:Free rake@0:Free web@1:Free by user demiansims@gmail.com
2019-05-20T19:19:53.639739+00:00 app[api]: Attach DATABASE (@ref:postgresql-defined-55908) by user demiansims@gmail.com
2019-05-20T19:19:53.656114+00:00 app[api]: @ref:postgresql-defined-55908 completed provisioning, setting DATABASE_URL. by user demiansims@gmail.com
2019-05-20T19:19:53.639739+00:00 app[api]: Running release v4 commands by user demiansims@gmail.com
2019-05-20T19:19:53.656114+00:00 app[api]: Release v5 created by user demiansims@gmail.com
2019-05-20T19:19:57.332749+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 46673 -e production`
2019-05-20T19:19:56.000000+00:00 app[api]: Build succeeded
2019-05-20T19:19:59.100443+00:00 heroku[web.1]: State changed from starting to crashed
2019-05-20T19:19:59.107493+00:00 heroku[web.1]: State changed from crashed to starting
2019-05-20T19:19:59.038377+00:00 app[web.1]: /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
2019-05-20T19:19:59.038393+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/lockfile_parser.rb:95:in `initialize'
2019-05-20T19:19:59.038394+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/definition.rb:83:in `new'
2019-05-20T19:19:59.038395+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/definition.rb:83:in `initialize'
2019-05-20T19:19:59.038397+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/dsl.rb:234:in `new'
2019-05-20T19:19:59.038398+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/dsl.rb:234:in `to_definition'
2019-05-20T19:19:59.038399+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/dsl.rb:13:in `evaluate'
2019-05-20T19:19:59.038402+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/definition.rb:34:in `build'
2019-05-20T19:19:59.038404+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler.rb:135:in `definition'
2019-05-20T19:19:59.038405+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler.rb:101:in `setup'
2019-05-20T19:19:59.038406+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/setup.rb:20:in `<top (required)>'
2019-05-20T19:19:59.038408+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
2019-05-20T19:19:59.038409+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
2019-05-20T19:19:59.038410+00:00 app[web.1]: from /app/config/boot.rb:3:in `<top (required)>'
2019-05-20T19:19:59.038411+00:00 app[web.1]: from bin/rails:3:in `require_relative'
2019-05-20T19:19:59.038413+00:00 app[web.1]: from bin/rails:3:in `<main>'
2019-05-20T19:19:59.079452+00:00 heroku[web.1]: Process exited with status 1
2019-05-20T19:20:02.333495+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 48713 -e production`
2019-05-20T19:20:05.071247+00:00 heroku[web.1]: State changed from starting to crashed
2019-05-20T19:20:05.054251+00:00 heroku[web.1]: Process exited with status 1
2019-05-20T19:20:04.972527+00:00 app[web.1]: /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
2019-05-20T19:20:04.972545+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/lockfile_parser.rb:95:in `initialize'
2019-05-20T19:20:04.972547+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/definition.rb:83:in `new'
2019-05-20T19:20:04.972548+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/definition.rb:83:in `initialize'
2019-05-20T19:20:04.972550+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/dsl.rb:234:in `new'
2019-05-20T19:20:04.972555+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/dsl.rb:234:in `to_definition'
2019-05-20T19:20:04.972557+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/dsl.rb:13:in `evaluate'
2019-05-20T19:20:04.972559+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/definition.rb:34:in `build'
2019-05-20T19:20:04.972560+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler.rb:135:in `definition'
2019-05-20T19:20:04.972562+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler.rb:101:in `setup'
2019-05-20T19:20:04.972563+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/bundler/setup.rb:20:in `<top (required)>'
2019-05-20T19:20:04.972565+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
2019-05-20T19:20:04.972566+00:00 app[web.1]: from /app/vendor/ruby-2.6.0/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
2019-05-20T19:20:04.972568+00:00 app[web.1]: from /app/config/boot.rb:3:in `<top (required)>'
2019-05-20T19:20:04.972570+00:00 app[web.1]: from bin/rails:3:in `require_relative'
2019-05-20T19:20:04.972571+00:00 app[web.1]: from bin/rails:3:in `<main>'
2019-05-20T19:20:10.571751+00:00 app[api]: Starting process with command `bundle exec rake db:migrate` by user demiansims@gmail.com
2019-05-20T19:20:13.762466+00:00 heroku[run.5828]: State changed from starting to up
2019-05-20T19:20:13.765155+00:00 heroku[run.5828]: Awaiting client
2019-05-20T19:20:13.799505+00:00 heroku[run.5828]: Starting process with command `bundle exec rake db:migrate`
2019-05-20T19:20:18.499328+00:00 heroku[run.5828]: State changed from up to complete
2019-05-20T19:20:18.474268+00:00 heroku[run.5828]: Process exited with status 20
2019-05-20T19:22:57.021525+00:00 app[api]: Starting process with command `bundle exec rake db:migrate` by user demiansims@gmail.com
2019-05-20T19:23:00.672287+00:00 heroku[run.2331]: State changed from starting to up
2019-05-20T19:23:00.689268+00:00 heroku[run.2331]: Awaiting client
2019-05-20T19:23:00.740482+00:00 heroku[run.2331]: Starting process with command `bundle exec rake db:migrate`
2019-05-20T19:23:05.400934+00:00 heroku[run.2331]: State changed from up to complete
2019-05-20T19:23:05.385380+00:00 heroku[run.2331]: Process exited with status 20
2019-05-20T19:24:17.980956+00:00 app[api]: Starting process with command `bundle exec rake db:migrate` by user demiansims@gmail.com
2019-05-20T19:24:20.590557+00:00 heroku[run.2935]: Awaiting client
2019-05-20T19:24:20.812085+00:00 heroku[run.2935]: State changed from starting to up
2019-05-20T19:24:20.609194+00:00 heroku[run.2935]: Starting process with command `bundle exec rake db:migrate`
2019-05-20T19:24:25.018756+00:00 heroku[run.2935]: State changed from up to complete
2019-05-20T19:24:24.994002+00:00 heroku[run.2935]: Process exited with status 20
2019-05-20T19:32:18.494661+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=faunagram-api.herokuapp.com request_id=53b89a56-41ac-46b6-b8e7-328c912db131 fwd="184.152.71.64" dyno= connect= service= status=503 bytes= protocol=https
2019-05-20T19:32:19.118662+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=faunagram-api.herokuapp.com request_id=ca60c3fa-0092-48d1-807d-30f1f77b9745 fwd="184.152.71.64" dyno= connect= service= status=503 bytes= protocol=https
Надеюсь, этого достаточно информации.Это был своего рода кошмар.