Heroku toolbelt on windows config:add causes broken paths - windows

Attempting to set LD_LIBRARY_PATH on my heroku rails app using the heroku toolbelt on windows wrongly substitutes the paths sent to the app.
Running the following using heroku toolbelt on windows:
heroku config:add LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib:/app/vendor/phantomjs/lib
Setting config vars and restarting... done, v164
LD_LIBRARY_PATH: C:\dev\Git\local\lib;C:\dev\Git\lib;C:\dev\Git\lib;C:\dev\Git\app\vendor\phantomjs\lib
It seems the toolbelt is automatically replacing "/usr" with "C:\dev\Git\" (where msysgit is installed on my system). Obviously this breaks my heroku app because these paths do not make sense on the server.

This is actually not a problem with Heroku toolbelt, it's documented behavior by msys (I'm assuming you're running this in msysgit). You can either run the command in a different shell (eg. Powershell) or use '//' at the start of the path like this:
heroku config:add LD_LIBRARY_PATH=//usr/local/lib://usr/lib:/lib://app/vendor/phantomjs/lib
This won't cause problems when the path is used on Linux.

Related

Installed Heroku but not recognised

I installed git and Heroku on my Windows8.1 64bit machine. On running:heroku --version I get the following error:
bash: heroku: command not found
What must I do to enable it?
Installing Heroku Toolbelt on Windows 10
bash: heroku: command not found
The error message is clear: Bash cannot find the heroku command, it's not on your PATH.
I checked, and the Heroku folder was added to the PATH.
It seems you didn't check it correctly.
Note that even if it looks correct in the PATH settings window,
Git Bash might have a different PATH configured.
To see the PATH in Git Bash, run:
echo $PATH
When debugging path issues,
it's best to first run heroku with the absolute path. For example if it's in C:\Program Files\Heroku\bin\heroku then you can run in Git Bash with:
/c/Program\ Files/Heroku/bin/heroku login
If this works (and it should),
then you can add it to PATH like this:
PATH="$PATH:/c/Program\ Files/Heroku/bin"
Note that Heroku will likely need other programs too on the PATH,
such as MySQL and Ruby.
Find their absolute paths,
and add there directories to PATH the same way as heroku itself in the above example.
If instead of Git Bash,
you want to work in CMD,
the procedure is the same,
but the syntax to print and set PATH is different:
echo %PATH%
set PATH="C:\Program Files\Heroku\bin;%PATH%"

Windows- Installing Heroku CLI

when installing Heroku CLI - I can only use the heroku in command line when I am inside \bin in my comand line. I have updated the environment variables and no other posts speak to this situation. - How can I have it act normally so I can use the commands while not in the \bin path, and actually use it for it's intended functionality. thank you!
Open windows bash and enter:
PATH="$PATH:/c/Program Files/Heroku/bin"
Heroku CLI should be added to path, you can test with:
heroku --version
what about adding these C:\Program Files\Heroku\bin in your environment variables path?

Heroku Toolbelt - Installed, yet Heroku Command not working

I've installed the Heroku Toolbelt, yet "heroku" commands (like heroku version) aren't working.
Do you have any idea about what could be wrong?
Thanks!
You need to add C:\Program Files\Heroku\bin (or whatever else directory where is it installed) to your PATH.

heroku error: Unable to connect to heroku API

I'm trying to access heroku from my command line, and I keep getting this same error: "Unable to connect to heroku API. Please check your internet connectivity and try again."
My internet connectivity is fine.
This question has been asked on StackOverflow before, but I don't quite understand the answer that seemed to be effective, as I'm a complete newbie. Apparently, it might have to do with an environment variable?
The other answer suggested a missing heroku remote branch, but mine is set up.
What, exactly, should I do to regain my connection with heroku?
Thanks!
Get the same message "Unable to connect to heroku API. Please check your internet connectivity and try again." when using heroku toolbelt on Mac.
In my case I installed the heroku toolbelt using homebrew. Installing the heroku toolbelt from https://toolbelt.heroku.com/ can solve the issue.
Well, it seems to have been a problem with my antivirus program . . . I reinstalled that, and heroku is accessible again.
If you’re behind a firewall that requires use of a proxy to connect with external HTTP/HTTPS services, you can set the HTTP_PROXY or HTTPS_PROXY environment variables in your local developer environment, before running the heroku command.
For example, on a Unix system you could do something like this:
$ export HTTP_PROXY=http://proxy.server.com:portnumber
or
$ export HTTPS_PROXY=https://proxy.server.com:portnumber
$ heroku login
On a Windows machine, either set it in the System Properties/Environment Variables, or do it from the terminal:
> set HTTP_PROXY=http://proxy.server.com:portnumber
or
> set HTTPS_PROXY=https://proxy.server.com:portnumber
> heroku login
I Got the same error on Mac OS X 10.13, and it's work for me, since I am behind the proxy,It's gathered from the Heroku Dev center page
https://devcenter.heroku.com/articles/using-the-cli

Bored to write app name in every heroku command though I got only 1 app [duplicate]

This question already has answers here:
Is there a way to set a default app for Heroku Toolbelt?
(3 answers)
Closed 1 year ago.
Heroku toolbelt is always forcing me to write an app name at the end like this:
heroku pg:reset DATABASE --app [app_name]
Is there a way to set the default app to which all my CLI heroku commands will apply?
Going to post this just in case it helps someone else out. I had the same problem even though there was only one app installed. I had to switch my heroku remote url from https to git.
https://git.heroku.com/[heroku-app-1234].git
to
git#heroku.com:[heroku-app-1234].git
Then everything worked normally for myself.
git remote remove heroku
git remote add heroku git#heroku.com:[heroku-app-1234].git
If heroku is claiming that there are multiple apps in the folder you must have more than one remote in your .git/config.
Remove the extra heroku remote or set the default using git config heroku.remote remote_name
If you have the heroku-accounts plugin installed, switching to the heroku branch worked for me, as discussed in this answer.
To swap out your existing version of the heroku-accounts plugin, use:
heroku plugins:install https://github.com/heroku/heroku-accounts.git
Note that if you've followed #Moemars answer, you'll need to switch your git remote back to https.
If you run heroku from the Git repo linked to your Heroku app, you don't have to specify an app name (unless the repo is connected to multiple apps).
This seems to be the easiest way to fix the issue:
heroku git:remote -a <app_name>
Since this wasn't mentioned until now:
Apart from the git remote, the Heroku CLI also looks into the HEROKU_APP environment variable.
By using direnv, dotenv or similar tools for project-specific environments you can easily set the respective Heroku app for each project or directory.

Resources