I can't seem to run any code on ruby with any text editor. This error is returned when code is run
/bin/bash: ruby: command not found
[Finished in 0.0s with exit code 127]
[shell_cmd: ruby "/home/user/Resume/ruby/WebScraper/redditscrape.rb"]
[dir: /home/user/Resume/ruby/WebScraper]
[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/user/.rvm/bin]
I found a similar question on stackoverflow sudo: ruby: command not found after ssh
As user terdon explains it's caused by ruby not being in the sudo path. So I tried sudo-ing my type ruby
but nothing happened. How do I fix this? Thanks in advance!
if this helps my type ruby
is /home/user/.rvm/rubies/ruby-2.2.2/bin/ruby
and my echo path is
/home/user/.rvm/gems/ruby-2.2.2/bin:/home/user/.rvm/gems/ruby-2.2.2@global/bin:/home/user/.rvm/rubies/ruby-2.2.2/bin:/home/user/.rvm/bin:/usr/local/heroku/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
whoami; echo $PATH
– A.B. Aug 17 '15 at 06:32/bin/ruby
is not in there. try adding it by issuing this command:
– AliReza Mosajjal Aug 17 '15 at 06:38export PATH=$PATH:$HOME/user/.rvm/rubies/ruby-2.2.2/bin/ruby