Skip to content

First ever push into a brand new heroku app fails #16

@hdushan

Description

@hdushan

While pushing to a brand new heoku app (first ever push to it), this error happens:

  • bundle exec rake deploy
    creating ssh key ... DONE
    adding ssh key ... DONE
    push git to heroku ...Warning: Permanently added 'heroku.com' (RSA) to the list of known hosts.
    Initializing repository, done.
    error: unable to push to unqualified destination: master
    The destination refspec neither matches an existing ref on the remote nor
    begins with refs/, and we are unable to guess a prefix based on the source ref.
    error: failed to push some refs to 'git@heroku.com:.git'

DONE
removing ssh key ... DONE
removing temp dir ... DONE

Here's the rake task "deploy":
task :deploy do
heroku = Heroku::API.new(:api_key => ENV["HEROKU_API_KEY"])
HerokuHeadless::Deployer.deploy(ENV["APP_NAME"])
end

Worked around this by adding a -u flag to the git push command in the gem, as below:
def git_push_command
cmd = "git push "
cmd << "-f " if HerokuHeadless.configuration.force_push
cmd << "-u git@heroku.com:#{@app_name}.git HEAD:refs/heads/master"
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions