9

I'm trying to set up for the first time with Rubber onto EC2 (complete_passenger_nginx_postgresql). I changed a bunch of settings in the config files to make it work with a different AMI (Ubuntu 12.04.3 LTS - ami-a73264ce (64-bit)), Ruby 2.1.0, Passenger 4.0.29, and Nginx 1.4.4. I almost got it to work, but it failed when starting Nginx with the following error:

nginx: [emerg] invalid number of arguments in "passenger_root" directive in /etc/nginx/nginx.conf:45

rubber-passenger_nginx.yml has the following code for "passenger_root":

passenger_lib: "#{passenger_root}/ext/nginx"

Any idea what I should change to make it work?

Ben
  • 2,957
  • 2
  • 27
  • 55
  • Please include your /etc/nginx/nginx.conf: line 45 – griffon vulture Dec 29 '13 at 09:58
  • Here: `/usr/local/rubies/2.1.0/lib/ruby/gems/2.1.0/gems/passenger-4.0.29;` and here is line 44 to 46: `passenger_root /usr/local/rubies/2.1.0/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/passenger-4.0.29 /usr/local/rubies/2.1.0/lib/ruby/gems/2.1.0/gems/passenger-4.0.29; passenger_ruby /usr/local/rubies/2.1.0/bin/ruby;` – Ben Dec 30 '13 at 21:45

2 Answers2

15

In My case, I have missed to mention ; at the end of the root directory declaration

Error:

root "/directory/with double quotes/will work"

Solution:

root "/directory/with double quotes/will work";
KARTHIKEYAN.A
  • 18,210
  • 6
  • 124
  • 133
3

You have an error in your /etc/nginx/nginx.conf file.

Change the lines:

passenger_root /usr/local/rubies/2.1.0/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static‌​/passenger-4.0.29
/usr/local/rubies/2.1.0/lib/ruby/gems/2.1.0/gems/passenger-4.0.29;
passenger_ruby /usr/local/rubies/2.1.0/bin/ruby;

into:

passenger_root /usr/local/rubies/2.1.0/lib/ruby/gems/2.1.0/gems/passenger-4.0.29;
passenger_ruby /usr/local/rubies/2.1.0/bin/ruby;
griffon vulture
  • 6,594
  • 6
  • 36
  • 57
  • 1
    Thanks. Yes, indeed you are right, but the problem is a little more complicated. In fact, in file "rubber-passenger_nginx.yml" the passenger root is extrapolated with the following string: `passenger_root: "#{`bash -l -c 'find #{ruby_path} -name passenger-#{passenger_version}'`.strip}"` so I replaced that with the hard coded path. Not an ideal solution, but that worked. I also had other issues later that needed to be solved and I'm still not done. Since it's a lot to write, I will post a link to a blog post where I share my misery and solutions, hopefully :) Thank you. – Ben Dec 31 '13 at 22:38
  • @BenKass I know this is way after the fact, but I was able to resolve this by adding a simple grep to the calculation of the passenger root directory so that it only returns the gem path and not the wrapped extension path. passenger_root: "#{`bash -l -c 'find #{ruby_path} -name passenger-#{passenger_version} | grep \\'gems/passenger\\''`.strip}" – plainjimbo Jul 16 '15 at 06:01