Ruby Error After Installing Heroku Toolbelt

Ruby error after installing heroku toolbelt

I had the same issues initially with ROR on Windows. (Everyone suggested me to move to LINUX/UNIX)

Still I managed to install it on Windows. Rather than installing the Heroku Toolbet (which breaks ruby and rails which is already installed) install the heroku gem along with foreman gem.

gem install heroku

gem install foreman

Then u can use it easily.

Heroku toolbelt error

Almost 6 months later, I got the exact same issue on the first interaction with heroku, not a good start.

I used the command to verify the installation:

heroku --version

It probably needs some additional data downloading for the first start and installing/preparing heroku-cli.

I am behind a corporate firewall and git + npm are working perfectly fine (after one-time proxy configuration).

The issue resolved automatically after some time along with initial frustration and time consumption. Just shared my experience for any next user landing here until the issue is actually resolved.

Log File extract:

Heroku client internal error. getaddrinfo: No such host is known.
(SocketError)

.

.

.

Heroku client internal error. getaddrinfo: This is
usually a temporary error during hostname resolution and means that
the local server did not receive a response from an authoritative
server. (SocketError)

[cross posted partially on the given heroku git link, same like the original question and answer]

Heroku Toolbelt - Ruby.exe : no such file or directory

The problem that I think you are having is that you moved the installation of Ruby from the top-level C:\ directory to an uncommon place where it will not be found by the system. When you install Ruby on Windows, it is advisable to have it in a place where it can always be accessed, whether you have administrative rights or not and in a folder that does not have any spaces or special characters in the name. When Ruby is installed correctly, it creates a folder called Ruby193 in my top-level directory: C:\Ruby193. In addition, your system Paths are modified through Windows Environment Variables and this is added to your path: C:\Ruby193\bin;. This allows you to run ruby followed by any command from any location through the command-line on the system. All that is left to do is install the heroku-toolbelt and things should be running smoothly.

Problems with heroku toolbelt

The problem is that the heroku executable you installed probably starts with a line like this:

#!/usr/bin/ruby

This will force the heroku command to always use the system-wide ruby (/usr/bin/ruby) and it will never run your rvm version of ruby.

To fix it simply edit the first line of the heroku script to this:

#!/usr/bin/env ruby

This will make the heroku command run whichever ruby command is in the current PATH, instead of a hard coded path like previously.

To find the location of the heroku script, so you can edit it, simply type:

which heroku

It should print out the location of the script so you can find it and load it into your editor.



Related Topics



Leave a reply



Submit