Not able to specify PassangerRuby at virtual host level on apache, weird error

22 views
Skip to first unread message

Arnold Roa

unread,
Oct 18, 2016, 10:28:33 AM10/18/16
to Phusion Passenger Discussions

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? 


Daniel Knoppel

unread,
Oct 18, 2016, 7:39:34 PM10/18/16
to Phusion Passenger Discussions
It would be good to mention you asked something similar a while ago here, but for Passenger 4: http://stackoverflow.com/questions/38385689/passenger-4-and-apache-is-not-using-the-right-ruby-version

If it sometimes works, sometimes not (especially with totally different versions of Passenger), then it sounds more like something is up with your configuration. In that case, you should post the full configurations, full error messages / traces, and show what is at the various folders that you are pointing to (e.g. do gems really exist there). Maybe you already discover something while collecting this information?

- Daniel

Daniel Knoppel

unread,
Oct 18, 2016, 7:40:55 PM10/18/16
to Phusion Passenger Discussions
For example:
| PATH=/home/ruby/.rvm/gems/ruby-2.2.1@test_project/bin: (this is ok.. i think)


I don't see an underscore between test and project as you have in the configuration file..

- Daniel
Reply all
Reply to author
Forward
0 new messages