macOS Catalina 10.15.5 Rails 6.0.3
I'll write a Rails tutorial and a lot of it. The tutorial is compliant with the 6th edition because I want to get used to Github.
$ heroku create
› Warning: heroku update available from 7.42.13 to 7.43.0.
Creating app... done, ⬢ *****
https://*****.herokuapp.com/ | https://git.heroku.com/*****.git
$ git push heroku master
remote: LoadError: cannot load such file -- uglifier
error: failed to push some refs to 'https://git.heroku.com/*****.git'
Refer to the following,
https://algorithm.joho.info/heroku/error-failed-to-push-some-refs-to/
$ git fetch
$ git rebase heroku/master
I ran, but it didn't work as shown below.
fatal: invalid upstream 'heroku/master'
Also, refer to the following https://ja.stackoverflow.com/questions/67934/git-push-heroku-master%E3%81%A7%E7%99%BA%E7%94%9F%E3%81%99%E3%82%8B%E3%82%A8%E3%83%A9%E3%83%BC-precompiling-assets-failed-error-failed-to-pu Try adding the ʻuglifier` gem to the Gemfile.
Gemfile
gem 'bootsnap', '1.4.5', require: false
gem 'uglifier'
Execute the following again
$ git commit -a -m "Update Gemfile for Heroku"
$ git push heroku master
remote: LoadError: cannot load such file --uglifier
disappeared
ʻError: failed to push some refs to ~` remains unchanged.
The error when executing $ git push heroku master
was as follows.
remote: ###### WARNING:
remote:
remote: This buildpack was created as a stop-gap measure to allow running applications with Bundler 2 on Heroku.
remote: Heroku now supports Bundler 2 directly: https://devcenter.heroku.com/changelog-items/1563
remote:
remote: Please discontinue use of this buildpack and instead directly use the `heroku/ruby` buildpack.
remote:
remote: To remove this buildpack use the `heroku buildpacks` command to list your existing buildpacks.
remote:
remote: If you only have one buildpack listed you can run:
remote:
remote: ```
remote: heroku buildpacks:set heroku/ruby
remote: ```
remote:
remote: If you have multiple buildpacks, you'll need to add the buildpack to the correct location using
remote: `heroku buildpacks:add heroku/ruby -i <correct index>` and then remove this buildpack via:
remote:
remote: ```
remote: heroku buildpacks:remove https://github.com/bundler/heroku-buildpack-bundler2
remote: ```
Only the following Buildpacks are available on $ heroku buildpacks
.
https://github.com/bundler/heroku-buildpack-bundler2
So run $ heroku buildpacks: set heroku / ruby
.
Buildpack set. Next release on pacific-atoll-18588 will use heroku/ruby.
Run git push heroku main to create a new release using this buildpack.
When you $ git push heroku master
again, this time the following warning.
remote: webpack binstubs not found.
remote: Have you run rails webpacker:install ?
remote: Make sure the bin directory or binstubs are not included in .gitignore
remote: Exiting!
https://archive.blog.inomar.me/2018/08/19/rails5-1%E3%81%A7webpack%E3%81%8C%E4%BD%BF%E7%94%A8%E3%81%A7%E3%81%8D%E3%82%8B%E3%81%AE%E3%81%A7vuejs%E3%81%A7%E9%81%8A%E3%82%93%E3%81%A7%E3%81%BF%E3%81%9F/
Execute $ bundle exec rails webpacker: install
referring to the above.
Even if I $ git push heroku master
again, the above warning does not disappear.
remote: webpack binstubs not found.
remote: Have you run rails webpacker:install ?
remote: Make sure the bin directory or binstubs are not included in .gitignore
remote: Exiting!
Run $ git push heroku main
.
error: src refspec main does not match any
error: failed to push some refs to 'https://git.heroku.com/*****.git'
I tried to force push with $ git push heroku main -f
, but the result was the same.
I deleted and recreated the git repository, recreated the heroku app, and added, commit, and pushed, but
The following error does not disappear ...
![remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/*****.git'
When I ran $ git push heroku main -f
again with no use, it was finally completed.
I think I've done a lot of meaningless downloads, so I'm worried that it will work safely after this ...
Recommended Posts