Nginx and passenger dependencies issue (Digital Ocean Deployment) Nginx and passenger dependencies issue (Digital Ocean Deployment) ruby-on-rails ruby-on-rails

Nginx and passenger dependencies issue (Digital Ocean Deployment)


I had the same problem on Ubuntu 14.10

sudo nano /etc/apt/sources.list.d/passenger.list

comment out
deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main

ctrl+x
Y
enter

sudo apt-get updatesudo apt-get install nginx nginx-extras

then if ok

sudo nano /etc/apt/sources.list.d/passenger.list

insert
deb https://oss-binaries.phusionpassenger.com/apt/passenger wheezy main

ctrl+x
Y
enter

sudo apt-get updatesudo apt-get install passenger

Voila !


If you are on Ubuntu 16.04 do the following

# Install our PGP key and add HTTPS support for APTsudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7sudo apt-get install -y apt-transport-https ca-certificates# Add our APT repositorysudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger xenial main > /etc/apt/sources.list.d/passenger.list'sudo apt-get update# Install Passenger + Nginxsudo apt-get install -y nginx-extras passenger


I used nginx-full instead of nginx-extras because of this very issue. I'm running 14.10 because I want Postgres 9.4.

There were a bunch of weird errors that I kept getting, and I accidentally kept following the Passenger directions past the APT instructions. Whoops. So I originally followed @Maciej-adamczewski 's answer, but he is adding a Debian 7 passenger install instead of an Ubuntu 14.04 install. This messed me up.

Here's what I did to get me sorted:

sudo apt-mark showhold  # apparently I had nothing in heresudo apt-get autocleansudo apt-get update && sudo apt-get upgrade# I hoped upgrade would get rid of that error re: nginx-extras# it didn't at all, so decided to scrap and start oversudo apt-get purge nginx*  # to get rid of everything nginxsudo apt-get remove nginx*  # paranoiasudo apt-get purge passengersudo apt-get remove passenger  # paranoia againsudo apt-get autoremovesudo apt-get updatesudo apt-get install nginx-full passenger

Boom! Got nginx to run properly.

It doesn't say on the Digital Ocean piece but if you installed RVM instead of ruby directly, you'll need to find out where your rvm ruby is:

rvm usepassenger-config --ruby-command

And then copy paste the nginx info that says passenger_ruby /usr/local/... and override the original passenger_ruby line in your /etc/nginx/nginx.conf file.

Later on, when you create sites, make sure you add in passenger_enabled on; in your server block for nginx!

mad props to this dude: Setting up rails on DO