Open goldtreefrog opened 6 years ago
My mentor and I were having the same problem; we were able to fix it by going into C:/Ruby23/lib/ruby/gems/2.3.0/gems/travis-1.8.8/lib/travis/cli/setup/heroku.rb and deleting a bit of code, so that the "run" function ultimately looks like this:
def run
deploy 'heroku' do |config|
config['api_key'] = `heroku auth:token`.strip
config['api_key'] = ask("Heroku API token: ") { |q| q.echo = "*" }.to_s if config['api_key'].empty?
config['app'] = `heroku apps:info`.scan(/^=== (.+)$/).flatten.first
config['app'] = ask("Heroku application name: ") { |q| q.default = repository.name }.to_s if config['app'].nil?
end
end
Your version of ruby is 2.4.0, but the paths should be the same. The command "travis setup heroku" should now work in your command prompt. Hope this helps.
Thanks for your solution. I worry that a later update will wipe it out - or maybe it will fix it!
I found a work-around that was easier, courtesy of Travis CI Documentation:
If you have both the Heroku and Travis CI command line clients installed, you can get your key, encrypt it and add it to your .travis.yml by running the following command from your project directory:
travis encrypt $(heroku auth:token) --add deploy.api_key
Doing that put the following into .travis.yml for me:
deploy:
api_key:
secure: (my api key)
Then I needed to add provider and app to the .travis.yml file, so that it ended up looking like this:
deploy:
provider: heroku
api_key:
secure: (the step above filled this in for you)
app: (your Heroku app name)
(Sorry I cannot get the code indented properly here. Everything is indented under "deploy" and "secure" is indented further under "api key." That makes it more clear.)
I am new to travis and not much more experienced with heroku. I recently updated Ruby and gems and removed old versions. I have travis integrated with github and all is well there. I have created a new repository successfully at heroku, so I have the same repository at github, heroku and on my local computer.
But I cannot get travis to play with heroku. When I type "travis setup heroku" - either in git bash or in the Windows command line - I get this response:
When I run travis report, I get:
When I run it in git bash, I also get asked for an authorization key, but when I enter it, the program just hangs (until I press Ctrl-C, at which point it tries to use the key I just entered as a new git command on the next line, so it isn't actually accepting a key).
What do I need to do differently?