I am looking for a path of where ruby gets stored on mac?
I installed macruby on my mac and I am trying to see where it got installed. I want to include the path of macruby in my ruby script. When I do rvm list, I get:
=> macruby-0.12 [ i686 ]
* ruby-1.9.3-p545 [ x86_64 ]
ruby-2.1.1 [ x86_64 ]
ruby-2.1.2 [ x86_64 ]
ruby-2.1.2-version [ x86_64 ]
I use #!/usr/local/bin/macruby
in my ruby script, but looks like macruby is not present in that location. When I execute "whereis ruby" command on I get back "/usr/bin/ruby"
, but when I execute "whereis ruby-1.9.3-p545"
or "whereis macruby-0.12"
I get nothing.
How do I find the path of where does all these ruby versions lie?
If you see /usr/bin/ruby , it is the pre-installed macOS system Ruby.
First of all, Ruby is already pre-installed on your Mac. However, the pre-installed version is a few versions behind so we'll look into the other ways to install Ruby. Using a package management system makes your life easier when installing any software. On a Mac, you can use Homebrew to install newer versions of Ruby.
Uninstall Ruby on Mac with rbenv Use the uninstall command to remove a version. This will remove any gems associated with the version as well. If you want to reinstall Ruby, see Install Ruby on Mac for recommendations of newer version managers.
Open Interactive Ruby If you're using macOS open up Terminal and type irb, then hit enter. If you're using Linux, open up a shell and type irb and hit enter. If you're using Windows, open Interactive Ruby from the Ruby section of your Start Menu.
You can get the path to the local executable with
$ which ruby
the rvm rubies are in your rvm directory, which I believe is ~/.rvm/rubies
(I use rbenv so not sure about the details)
The which command should pickup whatever shims/other magic RVM is using to set your shell ruby
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With