3

THIS HAS BEEN SOLVED READ ANSWER BELOW ON HOW TO DOWNLOAD HEROKU CLI ON RPI3

Just saying. Sorry if this has been asked before - I coudnt find it.

I have a Raspberry PI 3 and I am trying to install Heroku CLI. If I try to do it the normal way, for ubuntu or linux, it fails.Can't install Heroku CLI on Raspbian dosent wokr becasue i get error

wget https://cli-assets.heroku.com/branches/stable/heroku-OS-ARCH.tar.gz

--2018-05-23 17:15:46-- https://cli-assets.heroku.com/branches/stable/heroku-OS-ARCH.tar.gz
Resolving cli-assets.heroku.com (cli-assets.heroku.com)... 54.230.9.187, 54.230.9.194, 54.230.9.84, ...
Connecting to cli-assets.heroku.com (cli-assets.heroku.com)|54.230.9.187|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-05-23 17:15:50
ERROR 404: Not Found.

This post however dosent work either Heroku CLI alternative download location and returns error

    gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
dpkg: error processing package heroku (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of heroku-toolbelt:
 heroku-toolbelt depends on heroku (= 3.99.4); however:
  Package heroku is not configured yet.

dpkg: error processing package heroku-toolbelt (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 heroku
 heroku-toolbelt
E: Sub-process /usr/bin/dpkg returned an error code (1)

when i run the command

wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
botbotbotty
  • 183
  • 1
  • 2
  • 11
  • 5
    Possible duplicate of [Can't install Heroku CLI on Raspbian](https://stackoverflow.com/questions/45189549/cant-install-heroku-cli-on-raspbian) – Dalton Cézane May 23 '18 at 15:21
  • @Dalton Cézane i explained why its not duplicate – botbotbotty May 23 '18 at 16:27
  • try: https://stackoverflow.com/questions/41203702/heroku-cli-alternative-download-location – Dalton Cézane May 23 '18 at 17:58
  • @DaltonCézane Dosent work either i willl show error output in above post – botbotbotty May 23 '18 at 18:04
  • 1
    @botbotbotty, it looks like you're literally requesting `https://cli-assets.heroku.com/branches/stable/heroku-OS-ARCH.tar.gz`. The comment in the accepted answer on the question that Dalton first suggested says, 'Replace OS with one of “linux”, “darwin”, “windows”, “freebsd”, “openbsd”', and 'Replace ARCH with one of “amd64”, “386” or “arm”'. Did you do that? – ChrisGPT was on strike May 23 '18 at 18:07
  • @Chris Wow! I must have been blind then. Will try again – botbotbotty May 23 '18 at 18:09
  • @Chris Also does it matter if i use amd64 or 386 or arm(new to Heroku) – botbotbotty May 23 '18 at 18:11
  • 1
    @botbotbotty, that refers to the architecture of your local machine. For a Raspberry Pi I believe you want `arm`. – ChrisGPT was on strike May 23 '18 at 18:12
  • @Chris still getting errors following thos instructions i get this error when i run heroku --version – botbotbotty May 23 '18 at 18:31
  • its bash: /usr/local/bin/heroku: No such file or directory – botbotbotty May 23 '18 at 18:32
  • @Chris It is fine now it was a sudo permision error. Thanks for your help! – botbotbotty May 23 '18 at 18:41
  • @botbotbotty, I'm glad you got this working. Now that you've figured out all of the moving parts, please consider [posting your own answer](https://stackoverflow.com/help/self-answer) with all the details. This may help other users in the future. – ChrisGPT was on strike May 23 '18 at 18:44
  • will do when i have some more time – botbotbotty May 23 '18 at 19:17
  • @Chris , apparently it was really a duplicated question. I do not think it has to have an answer, since it will be fundamentally the same. Don't you agree? – Dalton Cézane May 23 '18 at 22:46
  • 1
    @DaltonCézane, probably, but that requires more close votes. In case that doesn't happen I'd prefer to have an answer here. And there may be slight differences with botbotbotty's situation; I'm curious about the `sudo` issue they mention. – ChrisGPT was on strike May 23 '18 at 22:48

2 Answers2

11

OK guys i figured it out. If the posts above didnt work for you this is how to do it This is how you install Heroku CLI onto a raspberry pi 3

Step 1: Make sure you have sudo privilages. The default RPI3 account has sudo so you need not worry about this If you cant get sudo privilages you may still be able to download the CLI .

How to check if you have sudo enabled run these following commands from terminal

sudo su

If you have sudo privileges the terimal should now say

root@ControlUnit:/home/[Your account name] 

or something along those lines. then run exit then continue with steps If it does continue with the next steps. If not- if you own RPI3 then login into the default account(password: raspberry) and do sudo adduser [yourname] -g sudo. If you do not own it ask the owner to do this

Sudo aside This is how you do the heroku CLI: Run the following commands

wget https://cli-assets.heroku.com/branches/stable/heroku-linux-arm.tar.gz

what this does is it installs a outdated copy(you can update it later) made for the Raspberry Pi. Then run this command

mkdir -p /usr/local/lib /usr/local/bin

This is the part where you have to use sudo. If you cant use sudo still try the commands.

sudo tar -xvzf heroku-OS-ARCH.tar.gz -C /usr/local/lib
sudo ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku

Then just make sure you have it run in the terminal

heroku version

or heroku --version

it should come up saying something along the lines of

heroku-cli/5.7.1-c574890 (linux-arm) go1.7.5

then run

heroku update

and your done!

COPY PASTE COMMANDS*

wget https://cli-assets.heroku.com/branches/stable/heroku-linux-arm.tar.gz

mkdir -p /usr/local/lib /usr/local/bin

sudo tar -xvzf heroku-linux-arm.tar.gz -C /usr/local/lib

sudo ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku

heroku update

botbotbotty
  • 183
  • 1
  • 2
  • 11
  • I did that and got an ```/home/berry/.local/share/heroku/client/bin/heroku: line 29: /home/berry/.local/share/heroku/client/bin/node: No such file or directory``` – RobZ Mar 10 '21 at 15:37
  • Updating the client broke it by throwing a segmentation fault – Besi Apr 26 '21 at 10:01
  • Just to add to this, trying to do this today on a Raspberry Pi 4. This approach (and others posted online) currently fail, I believe, because Heroku CLI now requires nodejs version 14+, and the version distributed on PiOS (64-bit) is 12. Possibly solvable by using nvm to upgrade nodejs, but I've not gone that step. The path of least resistance for me has been to find workrounds for deployment from a Pi, e.g. use Github deployment instead of 'heroku create'. Once deployed, the app can be managed using the CLI running on Windows – David Harris Jul 23 '23 at 09:56
2

Instead of sudo tar -xvzf heroku-OS-ARCH.tar.gz -C /usr/local/lib as noted in the original post, the correct command should be sudo tar -xvzf **heroku-linux-arm.tar.gz** -C /usr/local/lib