Error "bash: ruby: command not found"

Asked

Viewed 379 times

0

I’m trying to install Ruby on Rails on Windows, but I install and whenever I try to use Git BASH in the "Sites" folder that is created in the installation, this error appears. How can I fix?

Command I try to run: ruby -v

  • 1

    What command are you typing? Please edit your question and include command and full error =]

  • updated the question :)

  • please include the result of the following command: echo $PATH

1 answer

0


Most likely the program is not listed in your PATH.

You need to check the folder where the Ruby was installed, for example:

C: Ruby22-x64

Discovered this, you need to add the folder bin in his path.

Mode 1:

Go on the executar Win+R and type:

Systempropertiesadvanced

Then click on:

Environment variables (Environment Variables, in English)

And then inside Variáveis de usuário (User variables in English), make two clicks on Path, click on "New" (New in English) and add the following line (replacing with your installation path):

C: Ruby22-x64 bin

Mode 2:

In the prompt de comando, typhoon:

echo %path%>path.txt

To have a backup of path current and then:

setx path "%path%;C: Ruby22-x64 bin"

Replacing, of course, the address with your installation.


Beware of the setx command - it can delete your path!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.