0

When I try to deploy my Ruby on Rails app to Heroku I get some errors:

git push heroku master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 585 bytes | 585.00 KiB/s, done.
Total 5 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Rake app detected
remote: rake aborted!
remote: LoadError: cannot load such file -- bundler/setup
remote: /tmp/build_7852350a661d0da59c96dfb8f01c0e07/config/boot.rb:3:in `<top (required)>'
remote: /tmp/build_7852350a661d0da59c96dfb8f01c0e07/config/application.rb:1:in `require_relative'
remote: /tmp/build_7852350a661d0da59c96dfb8f01c0e07/config/application.rb:1:in `<top (required)>'
remote: /tmp/build_7852350a661d0da59c96dfb8f01c0e07/Rakefile:4:in `require_relative'
remote: /tmp/build_7852350a661d0da59c96dfb8f01c0e07/Rakefile:4:in `<top (required)>'
remote: (See full trace by running task with --trace)
remote:  !     Push rejected, failed to compile Rake app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to remojobs.
remote: 
To https://git.heroku.com/sampleapp-miro.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sampleapp-miro.git'

I use Ruby 2.4.0, Rails 5.2.3, and Bundler is 2.0.2.

Below I present full errors from heroku logs:

2019-06-29T18:04:32.000000+00:00 app[api]: Build started by user info@myemail.com
2019-06-29T18:04:34.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/8a339527-87e4-40c9-bee5-326119c29f60/activity/builds/a430cb9b-857a-4764-9abc-cefd14e45caf
2019-06-29T18:08:37.167236+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=sampleapp-miro.herokuapp.com request_id=f2ff0cfa-9faa-46d8-81c2-cd8c200fdc8a fwd="195.136.56.0" dyno= connect= service= status=503 bytes= protocol=https
2019-06-29T18:08:41.059684+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=sampleapp-miro.herokuapp.com request_id=456e9d84-7286-4b75-8a7d-50e397b9b8be fwd="195.136.56.0" dyno= connect= service= status=503 bytes= protocol=https
2019-06-29T18:09:09.000000+00:00 app[api]: Build started by user info@myemail.com
2019-06-29T18:09:10.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/8a339527-87e4-40c9-bee5-326119c29f60/activity/builds/c596ea0f-4936-45e1-a415-517178338c70
2019-06-29T18:13:26.000000+00:00 app[api]: Build started by user info@myemail.com
2019-06-29T18:13:27.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/8a339527-87e4-40c9-bee5-326119c29f60/activity/builds/c78a0330-354f-4c1f-b04e-24418ab36b02
2019-06-29T18:14:42.000000+00:00 app[api]: Build started by user info@myemail.com
2019-06-29T18:14:43.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/8a339527-87e4-40c9-bee5-326119c29f60/activity/builds/29cfa1cd-6af1-4bcc-8b4d-825e9131043c
2019-06-29T18:15:32.000000+00:00 app[api]: Build started by user info@myemail.com
2019-06-29T18:15:33.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/8a339527-87e4-40c9-bee5-326119c29f60/activity/builds/43c3e880-6880-4cc8-b8b1-5184e7d66c86
2019-06-29T18:17:04.000000+00:00 app[api]: Build started by user info@myemail.com
2019-06-29T18:17:05.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/8a339527-87e4-40c9-bee5-326119c29f60/activity/builds/d10a1410-48e9-48d1-9400-43a1b4fa0ea1

When I run heroku buildpacks I just see

Buildpack URL https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks

UPDATED

I used: heroku buildpacks:remove https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks

and after this:

git push heroku master

gives me below errors:

remote: Bundle completed (163.52s) remote: Cleaning up the bundler cache. remote: -----> Installing node-v10.15.3-linux-x64 remote: -----> Detecting rake tasks remote: ! Could not detect rake tasks remote: ! ensure you can run '$ bundle exec rake -P' against your app remote: ! and using the production group of your Gemfile. remote: ! Activating bundler (2.0.1) failed: remote: ! Could not find 'bundler' (= 2.0.1) - did find: [bundler-2.0.2] remote: ! Checked in 'GEM_PATH=vendor/bundle/ruby/2.4.0', execute 'gem env' for more information remote: ! To install the version of bundler this project requires, run gem install bundler -v '2.0.1' remote: /app/tmp/buildpacks/b7af56db6e6816adee09d510091abc07/lib/language_pack/helpers/rake_runner.rb:106:in 'load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError) remote: ensure you can run '$ bundle exec rake -P' against your app remote: and using the production group of your Gemfile. remote: Activating bundler (2.0.1) failed: remote: Could not find 'bundler' (= 2.0.1) - did find: [bundler-2.0.2] remote: Checked in 'GEM_PATH=vendor/bundle/ruby/2.4.0', execute 'gem env' for more information remote: To install the version of bundler this project requires, run gem install bundler -v '2.0.1'

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Miro
  • 374
  • 3
  • 10
  • 1
    Are your `Gemfile` and `Gemfile.lock` up to date, and included in your repository? – ChrisGPT was on strike Jun 29 '19 at 19:42
  • @Chris Yes, `Gemfile` and `Gemfile.lock` are included normally. – Miro Jun 29 '19 at 20:12
  • Please [edit] your question and add the log output that precedes what you've already shared. – ChrisGPT was on strike Jun 29 '19 at 20:15
  • I just edited the post and added the Heroku logs. – Miro Jun 29 '19 at 20:35
  • 1
    Okay, so your log says `No web processes running`. (a) What's in your `Procfile`? (b) Are your `Gemfile` and `Gemfile.lock` checked into your repository? – ChrisGPT was on strike Jun 29 '19 at 20:46
  • (a) I don't have this file in my project or I don't know that I have it. (b) yes, they are included. – Miro Jun 29 '19 at 21:04
  • Are the `Gemfile` and `Gemfile.lock` in the root (top directory) of your repository? Is that the complete build output? There should be a whole lot more. – ChrisGPT was on strike Jun 29 '19 at 23:31
  • @Chris Yes, it's normal that this files are in the root of project. Where are they supposed to be like not in the main catalog? – Miro Jun 30 '19 at 08:33
  • No, they should be in the root. I'm just trying to figure out why your build log is so short. It doesn't appear to install any dependencies... have you manually set a buildpack, or are you relying on buildpack detection? Try running `heroku buildpacks` and see what that says. – ChrisGPT was on strike Jun 30 '19 at 13:15
  • @Chris Hmm, `heroku buildpacks` shows only `Buildpack URL` `https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks` – Miro Jun 30 '19 at 14:05

2 Answers2

0

Hmm, heroku buildpacks shows only

Buildpack URL https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks

There's your problem. At some point you explicitly chose this buildpack, and it's the wrong one. I suggest removing the buildpack setting:

heroku buildpacks:remove https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks

Then run heroku buildpacks again. You should see something like

<your-app> has no Buildpack URL set.

Once that's done, redeploy your code. Heroku will recognize a Ruby project by the presence of a Gemfile and use the appropriate buildpack automatically.

Community
  • 1
  • 1
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • OK, I done your above suggestions. Everything is fine to time until bundle completed: `remote: ! Could not detect rake tasks` `remote: ! ensure you can run '$ bundle exec rake -P' against your app` `remote: ! and using the production group of your Gemfile.` `remote: ! Activating bundler (2.0.1) failed:` `remote: ! Could not find 'bundler' (= 2.0.1) - did find: [bundler-2.0.2]` `remote: ! Checked in 'GEM_PATH=vendor/bundle/ruby/2.4.0', execute 'gem env'` `remote: ! To install the version of bundler this project requires, run 'gem install bundler -v '2.0.1''` – Miro Jun 30 '19 at 15:00
  • This is very hard to read in a comment. Please edit your question and add the updated information there instead. – ChrisGPT was on strike Jun 30 '19 at 15:07
  • I see now one more thing: when I uninstall all bundler versions (2.0.1 and 2.0.2) and install 2.0.1 again as in below errors - I see that `Installing dependencies using bundler 2.0.2` when I try to `git push heroku master` again. Do you know why? – Miro Jun 30 '19 at 16:26
  • And on the bottom of Gemfile.lock is: `RUBY VERSION: ruby 2.4.0p0` and `BUNDLED WITH: 2.0.1` – Miro Jun 30 '19 at 17:05
  • OK, I solved above problem and I add the updated information. Thanks :) – Miro Jul 01 '19 at 15:01
  • [Please don't edit answers into your question or add "solved" to your title](https://meta.stackexchange.com/a/116105/248627). Instead, [mark an answer correct by clicking on the checkmark](https://meta.stackexchange.com/q/5234/248627). You can also [add your own answer](https://stackoverflow.com/help/self-answer) and accept it if none of the ones you received solved your problem. I have rolled back your question to the previous version. – ChrisGPT was on strike Jul 02 '19 at 15:11
0

OK, I solved the problem. Maybe it will help someone in the future:

  • update Ruby version to 2.6.1
  • gem uninstall bundler and install again gem install bundler -v 2.0.2
  • delete Gemfile.lock and bundle install
  • git push heroku master
  • it works :)
Miro
  • 374
  • 3
  • 10