Márcio Quental
Márcio Quental

Reputation: 51

Passenger using wrong ruby version

I'm running multiple websites on Apache with Passenger 4.0.45 on a CentOS server. I have multiple ruby versions installed too with rvm 1.25.27 and for the past 3 years I'm using Ruby 2.1.2 version. I have now started a new application with Rails 5.1 and I've needed to install Ruby 2.4.2. After deployed my application I'm getting an Internal Server Error and here it is the error I'm getting on error log:

App 10033 stderr: /usr/local/rvm/gems/[email protected]/gems/passenger-4.0.45/lib/phusion_passenger/request_handler.rb:356:in `trap'
App 10033 stderr: :
App 10033 stderr: Invalid argument - SIGKILL
App 10033 stderr:  (
App 10033 stderr: Errno::EINVAL
App 10033 stderr: )

I've noticed that the ruby version that shows up is [email protected] and I think it should be 2.4.2 because is the version that I'm specifying on VirtualHost file:

<VirtualHost *:80>
   ServerName example.com
   DocumentRoot /.../current/public
   PassengerRuby /home/user/.rvm/wrappers/ruby-2.4.2@global/ruby
   <Directory 
        /home/user/.../current/public>
        AllowOverride all
        Options -MultiViews
  </Directory>
</VirtualHost>

I've read about this bug on https://github.com/phusion/passenger/issues/1362 but I don't know if I can update Passenger without messing up other sites that I'm running with old versions of Ruby.

Upvotes: 2

Views: 3657

Answers (1)

M&#225;rcio Quental
M&#225;rcio Quental

Reputation: 51

I've found the answer to my question. I will explain what I did:

  • rvm install 2.4.2 (Install Ruby version 2.4.2)
  • rvm use 2.4.2 (Use Ruby 2.4.2 version)
  • gem install passenger (Install Passenger gem)
  • passenger-install-apache2-module (This will guide you throught the installation of the Passenger module for Apache. It takes around 3 minutes)
  • After the installation process of the Passenger module, I've updated my httpd.conf file with new LoadModule and PassengerRoot specified by the installation summary)
  • rvmsudo passenger-config validate-install (Check if Passenger installed correctly)
  • sudo service httpd restart (Restart Apache)

After did the above commands, my new application with Rails 5.1 is working as well as every other site in the server running on lower Ruby/Rails versions.

Upvotes: 3

Related Questions