-2

I recently installed the latest version of Ruby which is 2.4.1 to run a script that required a gem called prawn. Now, I installed ruby using Homebrew and did the export path within ~/.bash_profile, however, removing the $PATH statement is not allowing me to revert back to 2.0.0 (system default) any idea, how, or why.

What I did try doing was uninstalling ruby with homebrew, (the latest version) however, that just removed ruby all together; using ruby -v would say there was no ruby actually installed despite the fact that 2.0.0 is still there.

ruby -v returns ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

which ruby returns /usr/local/bin/ruby

whereis ruby returns /usr/bin/ruby

echo $PATH returns /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

SOLVED. Used brew unlink ruby

zak
  • 97
  • 9
  • Most common reason: your $PATH is still wrong. Basic commands for troubleshooting: `which ruby`, and `echo $PATH`. If you need more help then please post the results of those commands here too. – Casper May 09 '17 at 15:05
  • `which ruby` gives me /usr/local/bin/ruby – zak May 09 '17 at 15:14
  • `echo $PATH` gives me /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin – zak May 09 '17 at 15:15
  • What $PATH statement did you remove? you may need to launch a new shell/terminal window to reflect the change. Editing the .bash_profile won't magically change your existing window. – Joe May 09 '17 at 15:23
  • Joe, I did, I even restarted my laptop and used the source .bash_profile. The $PATH statement I used in the first place was to get the latest version to work correctly, see here:[link](http://stackoverflow.com/questions/12287882/installing-ruby-with-homebrew) – zak May 09 '17 at 15:28
  • I've solved it anyways, had to use `brew unlink ruby` Thanks anyways. – zak May 09 '17 at 17:31
  • You can answer & accept your own question, that way it doesn't appear unsolved. – max pleaner May 09 '17 at 18:30

1 Answers1

0

Just unlinked homebrew from Ruby by using brew unlink ruby.

zak
  • 97
  • 9