Search code examples
rubyrvmpassengerruby-on-rails-5macos-sierra

How do I get /usr/bin/ruby to point to the right version of Ruby on my Mac?


I’m using Ruby 2.3 (I think) on Mac Sierra. How do I make /usr/bin/ruby point at the correct version of Ruby? I reinstalled version 2.3.0 (the one I want to use) through rvm and set it as the default, but still no love …

localhost:~ davea$ rvm use 2.3.0 --default
Using /Users/davea/.rvm/gems/ruby-2.3.0
localhost:~ davea$ /usr/bin/ruby --version
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

The reason I need this version is that its used for Rails 5 and I need to tell passenger the path of where Ruby is installed.


Solution

  • When the correct ruby is set using rvm, run passenger-config about ruby-command to find out what to set PassengerRuby to.

    Source: https://www.phusionpassenger.com/library/deploy/apache/deploy/ruby/#determine_ruby_command