Nginx and passenger dependencies issue (Digital Ocean Deployment)

12,607

Solution 1

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 update

sudo 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 update

sudo apt-get install passenger

Voila !

Solution 2

If you are on Ubuntu 16.04 do the following

# Install our PGP key and add HTTPS support for APT
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
sudo apt-get install -y apt-transport-https ca-certificates

# Add our APT repository
sudo 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 + Nginx
sudo apt-get install -y nginx-extras passenger

Solution 3

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 here
sudo apt-get autoclean
sudo 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 over

sudo apt-get purge nginx*  # to get rid of everything nginx
sudo apt-get remove nginx*  # paranoia
sudo apt-get purge passenger
sudo apt-get remove passenger  # paranoia again
sudo apt-get autoremove

sudo apt-get update
sudo 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 use
passenger-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

Solution 4

When i got this error it was because the version of passenger i was trying to install didn't match the version of ubuntu. Check you are on ubuntu 14.04.

If not the line deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main in /etc/apt/sources.list.d/passenger.list needs to change to match your version of ubuntu.

Then run sudo apt-get update

Share:
12,607

Related videos on Youtube

Sebas Mardini
Author by

Sebas Mardini

Updated on July 01, 2022

Comments

  • Sebas Mardini
    Sebas Mardini almost 2 years

    Im trying to follow this guide

    https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-passenger-and-nginx-on-ubuntu-14-04

    When I want to continue with the tutorial after running this command:

    sudo apt-get install nginx-extras passenger
    

    I get this error:

    Reading package lists... Done
    Building dependency tree
    
    Reading state information... Done
    passenger is already the newest version.
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
    nginx-extras : Depends: perlapi-5.18.2 but it is not installable
    Depends: libperl5.18 (>= 5.18.2) but it is not installable
    Recommends: passenger (< 4.0.60) but 1:4.0.59-1~trusty1 is to be installed
    E: Unable to correct problems, you have held broken packages.
    

    I think that I can't install nginx-extras, Somebody can help me please?

    • andrewsomething
      andrewsomething over 9 years
      Do you have any additional third-party repositories added besides the one mentioned in the tutorial?
  • akaHeimdall
    akaHeimdall about 8 years
    Thanks much. I know it's been a year but this was exactly the thing I needed!
  • JustinParker
    JustinParker almost 8 years
    If you aren't quite sure what release you are on, you can cat /etc/os-release to get some more info. In my case, I thought I was on trusty but actually on xenial.
  • George Varghese
    George Varghese over 7 years
    I'm facing the same issue.. my ubuntu version is 15.10
  • Grant Neufeld
    Grant Neufeld over 6 years
    Be sure to backup any config files you’ve worked on for nginx or passenger before running the above commands. apt-get purge wipes out associated config files.
  • Crashtor
    Crashtor about 6 years
    Works for me still.
  • Atul
    Atul over 4 years
    Worked like charm! You saved my day :)
  • Deshan
    Deshan about 4 years
    Works on ubuntu 18.04 LTS
  • Ali Behzadian Nejad
    Ali Behzadian Nejad almost 4 years
    If you still get errors, replace "wheezy" with "jessie".