2

I am trying to ask RVM for current Ruby path, to call it from bash. This happens in Xcode environment, where ruby is Xcode's one, but I wanna to solve it like this (just example, not really works):

$(rvm which) my-script.rb

Help me to ask RVM for current Ruby path :)

k06a
  • 17,755
  • 10
  • 70
  • 110
  • Where have you searched and what did you read? Did you read through https://rvm.io/integration? We need you to tell us what you tried and where you looked, otherwise we'll suggest things that could be duplicates of your effort, which wastes both our times. "[ask]" and the linked pages talk about this. – the Tin Man Aug 10 '16 at 21:13
  • @theTinMan I have read `man` and some docs in web, but found only `rvm environment` command, it contains info I need, but it is not simple to extract this info directly. – k06a Aug 10 '16 at 21:18
  • @k06a is my post helpful? – Maciej Małecki Aug 15 '16 at 08:36
  • @smefju sorry, but no. My problem is to make Xcode to use RVM's Ruby instead of it's own Ruby version. – k06a Aug 15 '16 at 13:23
  • take a look at this topic: http://stackoverflow.com/questions/15776319/how-to-make-xcode-use-the-correct-version-of-ruby-when-running-a-script – Maciej Małecki Aug 15 '16 at 13:28

1 Answers1

2

You can use which ruby. It will point to the binary from currently used Ruby. Take a look at this page: https://rvm.io/rvm/basics.

You should also take a look at this topic: How to make xcode use the correct version of ruby when running a script?

Community
  • 1
  • 1
Maciej Małecki
  • 2,725
  • 19
  • 29