Unable to install Ruby on Ubuntu Machine

Posted October 28, 2014 3.1k views

I was following the Tutorial Here

But I get this error just trying to install ruby.

Command ‘ruby’ is available in ’/usr/local/bin/ruby’ The command could not be located because ’/usr/local/bin’ is not included in the PATH environment variable.

Someone wanted me to apply :

That’s weird. /usr/local/bin should be included in the PATH variable. Edit /etc/environment and add :/usr/local/bin at the end of the file before the quotation mark.

Then log out and log back in.

Which did not work.

My current setup is a drupal site that was setup by Ajenti, but Ajenti should just be configuring the nginx configs, it shouldn’t have any problem with ruby.

My end goal is to install snorby and foreman as well.

1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Sorry Mr ASB, I had some work related issues come up and it threw me for a loop these past few weeks.

Echo :
root@PassItOn-Main:/# echo $PATH /sbin:/usr/sbin:/bin:/usr/bin

P.S. Please ignore the fact im using root :) i’ll be fixing that on my official setup.

When typing in the second command it didn’t give an error, nor any other response.

  • Like we suspected, it looks like /usr/local/bin in not included in your PATH. The second command just temporarily adds it. Can you run it can then run ruby afterwards?

    Make sure the contents of the file /etc/environment look like: