The rails app cannot be deployed to heroku

Asked 1 years ago, Updated 1 years ago, 85 views

What do you want to do

  • I want to deploy the rails app to heroku

environment

  • Ruby 2.4.0

  • Ruby on Rails 5.1.6

  • bundler 2.0.1

  • Javascript runtime:node.js

Ruby 2.4.0

Ruby on Rails 5.1.6

bundleer 2.0.1

Javascript runtime:node.js

Current State

In the vagrant environment, we check the rails server startup and browser display.

Problems and error messages

  • Git push heroku master will fail deployment
  • heroku buildpack will be set to node.js
2019-10-03T21:33:48.503244 + 00:00 heroku [web.1]: Starting process with command `bundle exec rails server-p28886`
2019-10-03T21:33:50.666191 + 00:00 heroku [web.1]: Process expired with status1
2019-10-03 T21:33:50.708819 + 00:00 heroku [web.1]: State changed from starting to crash
2019-10-03 T21:33:50.712474 + 00:00 heroku [web.1]: State changed from crashed to starting
2019-10-03T21:33:50.586012+00:00 app [web.1]: /usr/lib/ruby/2.5.0/rubygems.rb:289: in `find_spec_for_exe': Could not find 'bundler' (2.0.1) required by your/app/Gemfile.lock.(Gem:GemNotFoundException)
2019-10-03T21:33:50.586039 + 00:00 app [web.1]: To update to the last version installed on your system, run `bundle update --bundler`.
2019-10-03 T21:33:50.586041 + 00:00 app [web.1]: To install the missing version, run`gem install bundle: 2.0.1`
2019-10-03T21:33:50.586047 + 00:00 app [web.1]: from /usr/lib/ruby/2.5.0/rubygems.rb:263:in`bin_path'
2019-10-03T21:33:50.586049 + 00:00 app [web.1]:from/app/bin/bundle:3:in`<main>'
remote:----->App not compatible with buildpack:https://github.com/heroku/heroku-buildpack-ruby.git
remote —More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote —Verifying deploy...
remote:
remote: !Push rejected to your-appname

Tried

  • Change the bundleer version to 2.0.1 and regenerate Gemfile.lock

https://qiita.com/haru52/items/c2e062f6e1c7d4ecfe49

  • Modify Gemfile as it was lowercase Gemfile

https://qiita.com/leavescomic1/items/ca938f4637b125da5bcf

  • Deploy buildpacks with heroku/ruby

https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-ruby

https://dhtakeuti.hatenablog.com/entry/2018/12/11/142638

https://devcenter.heroku.com/articles/buildpacks#detection-failure

It's hard to solve this problem, so please take care of it.

ruby-on-rails ruby heroku rubygems bundler

2022-09-30 14:06

1 Answers

heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2 Why don't you try it?


2022-09-30 14:06

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.