Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is ruby stored on mac?

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?

like image 479
tech_human Avatar asked Aug 14 '14 16:08

tech_human


People also ask

Where is Ruby installed?

If you see /usr/bin/ruby , it is the pre-installed macOS system Ruby.

Is Ruby installed on Mac by default?

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.

Can I delete Ruby folder in Mac?

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.

How do I open a Ruby file on Mac?

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.


Video Answer


1 Answers

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

like image 194
John Paul Ashenfelter Avatar answered Oct 17 '22 23:10

John Paul Ashenfelter