I've a passanger 5.0.30 installation that works fine most of the time, and when I do a deploy with capistrano it got broken, and tries to use the wrong ruby interpreter. Sometimes it used to get fixed when I restarted apache.
Today I did a deploy and it's not longer working when restartin apache, this is my first config on httpd.conf:
LoadModule passenger_module /home/ruby/.rvm/gems/ruby-2.1.2/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/ruby/.rvm/gems/ruby-2.1.2/gems/passenger-5.0.30
PassengerDefaultRuby /home/ruby/.rvm/gems/ruby-2.1.2/wrappers/ruby
# PassengerDefaultRuby /home/ruby/.rvm/gems/ruby-2.2.1@test_project/wrappers/ruby
PassengerLogLevel 2
PassengerDebugLogFile /var/log/passenger.log
PassengerResolveSymlinksInDocumentRoot on
PassengerFriendlyErrorPages on
</IfModule>
Then, on a virtualhost i've this:
PassengerRuby /home/ruby/.rvm/gems/ruby-2.2.1@test_project/wrappers/ruby
PassengerUser ruby
<Directory "/home/ruby/public_html">
AllowOverride all
Options -MultiViews +ExecCGI +FollowSymlinks -SymLinksIfOwnerMatch
</Directory>
With that configuration i get a not able to find gem error, and its using the default ruby interpreter instead of the one specified in the virtual host:
...Could not find climate_control-0.0.3 in any of the sources (Bundler::GemNotFound)
/home/ruby/.rvm/gems/ruby-2.1.2/..
If on the main passenger config i change the PassengerdefaultRuby to the version i'm trying to set on the VirtualHost it works perfectly.
If I remove the PassengerDefaultRuby and leave only PassengerRuby on the virtualhost i get this weird error:
Raw process output:
stdin: is not a tty
*** ERROR ***: Cannot execute 2\C: No such file or directory (2)
- Ruby interpreter command
2\C
PATH=/home/ruby/.rvm/gems/ruby-2.2.1@test_project/bin: (this is ok.. i think)
What could be the reason?