I am using Ruby on Rails 3.2.2 and RVM (Ruby Version Manager). By using RVM I installed 2 Ruby versions: first 1.9.3 and then 1.9.2. After I run the rvm use --default 1.9.2 command line I closed and reopened the Terminal window. Finally I run the following command lines in the Terminal window:
$ which ruby
/<MY_USER_PATH>/.rvm/rubies/ruby-1.9.2-p318/bin/ruby
$ ruby -v
ruby 1.9.2p318 (2012-02-14 revision 34678) [x86_64-darwin10.8.0]
However, if I add the <%= "Ruby version #{RUBY_VERSION}" %> code in a view file of my Ruby on Rails project I get Ruby version 1.9.3.
Why my Ruby on Rails project is still running with the Ruby version 1.9.3? How can I make that to run in Ruby 1.9.2?
Passenger doesn’t care about RVM, you need to compile Passenger with the Ruby version you want to use, and follow its instructions to setup Apache’s configuration accordingly.
If you want to switch Ruby versions, you need to reinstall Passenger’s Apache module via
passenger-install-apache-moduleand follow the instructions.You will likely see that the
PassengerRubydirective in your Apache config is pointing to a specificruby.If you need different Ruby versions with Passenger, Phusion’s blog post on this may be helpful. RVM’s docs on Passenger integration are worth reading as well.