(guest@joequery.me)~ $ |

ERROR Heroku setting up iojs - no such file or directory

Computer specifications

These issues were encountered on Ubuntu Server 14.04

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:        14.04
Codename:       trusty

Problem description and symptom checking

(Use this section to determine if your system exhibits similar behavior.)

I haven't used Heroku in a while, but I needed to resolve an issue on an old project hosted on Heroku. I attempted to clone the project

$ heroku git:clone -a myproject

But encountered the following error

Setting up iojs-v2.2.1... ▸    rename /home/myusername/.heroku/tmp/node215313927/iojs-v2.2.1-linux-x86 /home/myusername/.heroku/iojs-v2.2.1-linux-x86: no such file or directory
error loading plugin commands
Installing Heroku Toolbelt v4... done
Setting up iojs-v2.2.1... ▸    rename /home/myusername/.heroku/tmp/node980470436/iojs-v2.2.1-linux-x86 /home/myusername/.heroku/iojs-v2.2.1-linux-x86: no such file or directory
Setting up iojs-v2.2.1... ▸    rename /home/myusername/.heroku/tmp/node257388525/iojs-v2.2.1-linux-x86 /home/myusername/.heroku/iojs-v2.2.1-linux-x86: no such file or directory
Setting up iojs-v2.2.1... ▸    rename /home/myusername/.heroku/tmp/node396552127/iojs-v2.2.1-linux-x86 /home/myusername/.heroku/iojs-v2.2.1-linux-x86: no such file or directory

And the project was not cloned.

Symptom 1 - iojs error appearing elsewhere

I realized that after attempting to run the git:clone command, just running the heroku command on its own would also show the Setting up iojs- error.

$ heroku
Setting up iojs-v2.2.1... ▸    rename /home/myusername/.heroku/tmp/node139248482/iojs-v2.2.1-linux-x86 /home/myusername/.heroku/iojs-v2.2.1-linux-x86: no such file or directory
error loading plugin commands
Usage: heroku COMMAND [--app APP] [command-specific-options]

Primary help topics, type "heroku help TOPIC" for more details:

  addons    #  manage addon resources
  apps      #  manage apps (create, destroy)
  auth      #  authentication (login, logout)
  ...
  ...
  ...
  ...

Symptom 2 - Heroku toolkit version mismatch

I checked my Heroku toolkit version

$ heroku --version
heroku-toolbelt/3.38.1 (i686-linux) ruby/2.0.0
You have no installed plugins.

This seemed strange since earlier the git:clone command indicated that Heroku Toolbelt v4 was successfully downloaded. (Installing Heroku Toolbelt v4... done)

Solution

First we're just going to remove the Heroku toolbelt and reinstall, just to make sure everything is as up to date as possible.

(Credit to this stackoverflow answer for the instructions.)

Removing the Heroku toolbelt

$ sudo apt-get --purge remove heroku
$ sudo apt-get --purge remove heroku-toolbelt

Removing the .heroku directory

$ rm -rf ~/.heroku

Reinstalling the Heroku toolbelt

$ wget -O heroku_install.sh https://toolbelt.heroku.com/install-ubuntu.sh
$ bash heroku_install.sh

The heroku installation should be fixed now.

Verification of solution

Attempt to clone repo

You should now be able to clone the repo of a heroku project

$ heroku git:clone -a myproject
Installing Heroku Toolbelt v4... done
Setting up iojs-v3.2.0... done
Installing core plugins heroku-apps, heroku-fork, heroku-git, heroku-local, heroku-run, heroku-status... done
Cloning into 'myproject'...

Success!

Correct version information

You should see version 4 of the heroku-cli when you ask for the heroku commands version.

$ heroku --version
heroku-toolbelt/3.41.4 (i686-linux) ruby/2.0.0
heroku-cli/4.22.0-568f192 (386-linux) go1.5
=== Installed Plugins
...
...
...

Tagged as utilities

Date published - August 26, 2015