Nginx and passenger dependencies issue (Digital Ocean Deployment)
Asked Answered
D

5

24

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?

Destruct answered 2/3, 2015 at 20:8 Comment(1)
Do you have any additional third-party repositories added besides the one mentioned in the tutorial?Twoway
M
73

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 !

Mims answered 7/3, 2015 at 7:21 Comment(4)
Thanks much. I know it's been a year but this was exactly the thing I needed!Pebrook
Works for me still.Debauchery
Works on ubuntu 18.04 LTSCatinacation
If you still get errors, replace "wheezy" with "jessie".Muskogean
B
33

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
Beneficial answered 10/10, 2016 at 22:7 Comment(2)
I'm facing the same issue.. my ubuntu version is 15.10Heathcote
Worked like charm! You saved my day :)Echoechoic
S
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

Sulfa answered 27/3, 2015 at 4:49 Comment(1)
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.Earwitness
Q
2

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

Quit answered 15/1, 2016 at 9:12 Comment(1)
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.Coenzyme
V
0

Maybe ubuntu version error,try with this command:

sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger xenial main > /etc/apt/sources.list.d/passenger.list'
Vacate answered 12/2, 2018 at 20:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.