remote rejected master -> master (pre-receive hook declined)

后端 未结 21 1648
我在风中等你
我在风中等你 2020-11-30 01:31

I\'m working in rails 3.2 and I receive an error when I try to push to heroku:

 git push heroku master
Counting objects: 496, done.
Delta compression using u         


        
相关标签:
21条回答
  • 2020-11-30 02:18

    If you run $ heroku logs you may get a "hint" to what the problem is. For me, Heroku could not detect what type of app I was creating. It required me to set the buildpack. Since I was creating a Node.js app, I just had to run $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs. You can read more about it here: https://devcenter.heroku.com/articles/buildpacks. No pushing issues after that.

    I know this is an old question, but still posting this here incase someone else gets stuck.

    0 讨论(0)
  • 2020-11-30 02:18

    If you get this error and the terminal is not descriptive enough to help you, Heroku might be able to tell you what is wrong through their website. Try the following:

    1. log in to Heroku and go to your dashboard;
    2. select the problem application from the list; and,
    3. check the build logs under the "Activity" tab.

    In my case, I had accidentally ignored my Gemfile.lock.

    0 讨论(0)
  • 2020-11-30 02:18

    simple answer

    $ heroku config:set DISABLE_COLLECTSTATIC=1
    
    

    after

    $ git push heroku master
    
    
    0 讨论(0)
  • 2020-11-30 02:19

    I had the same issue.

    Look at your git ignore and check if .env is not ignored.

    It was my problem and resolved to my case.

    0 讨论(0)
  • 2020-11-30 02:21

    Check the following

    1. Make sure you add all the files and directories needed to be tracked are added using git status [You have done this]

      $ git status

    2. If not added then add them using **git add . ** [You have done this]

      $ git add .

    3. Bundle all gems and you will have Gemfile.lock

      $ bundle install
      $ git add Gemfile.lock
      $ git commit -am "Added Gemfile.lock"

    4. Push it to heroku

    $ git push heroku master

    Your push should work

    0 讨论(0)
  • 2020-11-30 02:25

    The package setuptools/distribute is listed in requirements.txt. Please remove the same.

    0 讨论(0)
提交回复
热议问题