Home>
(Beginner) Failed to deploy to Heroku. The cause is bundler ... ??? Contents of question

When I try to deploy to Heroku, the following message appears and I cannot deploy.

What I tried

Do'''$heroku run rails c'''and search for the cause,

Running rails c on ⬢ shrouded-beyond-08619 ... up, run.7961 (Free)
Traceback (most recent call last):
4: from/app/bin/rails: 3: in

'
3: from/app/bin/rails: 3: inload'
2: from/app/bin/spring: 8: in'
1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:inrequire'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file --bundler (LoadError) I think there is something wrong with the bundler.

Do'''$gem install bundler''' Successfully installed bundler-2.1.4 Parsing documentation for bundler-2.1.4 Done installing documentation for bundler after 2 seconds 1 gem installed And the installation was successful, so after doing bundle install and git push I tried git push heroku master again, but the screen looks like the image again. I'm sure that the URL is correct because I'm accessing the deployment destination link properly. .. ..

I'm stuck, so please help me.

Link referred to below ↓

The rails command gives `require': cannot load such file --bundler (LoadError).
https://www.tutorialfor.com/go.php?id=251294

  • Answer # 1

    Was self resolved!

    Summary

    The deployment was completed, but Heroku decided that it was a Node (JavaScript) application even though it was a Ruby application, and bundle install was not done during the deployment process.

    The reason is that I forgot to bundle install, Heroku will not judge it as a Ruby application without Gemfile and Gemfile.lock

    I recreated the application on heroku and tried to deploy it

    I got an error around bundler

    Heroku can support bundler 2 series using a third party (not recommended), but official support is 1 series

    Drop the bundler ver of Gemfile from 2 series to 1 series