Question

I have a rails 2 application which I want to run on Apache or Nginx, but for both of them I am getting the same error:

Error facing for both Apache and nginx

nginx.conf

     passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
     passenger_ruby /usr/bin/ruby;

    ##
    # Virtual Host Configs

    server {
            listen 80;
            server_name web.test.com;
            root /home/vishal/workspace/website/public;
            passenger_enabled on;
    }
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;

The app is running fine with passenger standalone, but causing issues with nginx and apache.

I tried to understand the supporting doc but could not find the solution. I want to use nginx for the app.

Was it helpful?

Solution

So the issue was that you're running your app under the wrong Ruby. You intended it to be run under RVM Ruby 1.8, but it was actually being run under Ruby 1.9 thanks to the "passenger_ruby /usr/bin/ruby" option that you see there.

You need to use the passenger_ruby config option to tell Passenger to use RVM Ruby 1.8. The documentation teaches you how to set this option properly when using RVM.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top