Skip to main content

Deploy Ubuntu 18.04 Bionic Beaver Discussion

General • Asked by Chris Oliver
26e51388251924c2c3628dc6670f81a2
Thanks for this article, Chris! I'm struggling to get past the step of installing NGINX with Passenger. The command 
sudo apt-get install -y nginx-extras passenger
...results in a message about several dependencies that are not installable. Do you know how to get around this?


8f790db678500edd15b0fd35e6424f75

# Add Passenger APT repository
sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main > /etc/apt/sources.list.d/passenger.list'
sudo apt-get update

Make sure it's bionic and not xenial - if you've already run this step, you'll have to update 
 /etc/apt/sources.list.d/passenger.list
to make sure it's bionic as well


9df65848cf20709ce655d846ca35e562
phusionpassenger - just updated its nginx - passenger instructions & software.

https://www.phusionpassenger.com/library/install/nginx/install/oss/bionic/

Ce795239ba5dd2384fc2f88ffaff5451
Thanks btihen! I'll get the tutorial updated for its changes shortly!

4914d1cb68cd66b64bca7067334ae5a4
When I tried to start nginx (sudo service nginx start), I got the following error:
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
Problem: There was no /usr/sbin/nginx directory.

I solved the problem by: sudo apt-get install nginx
but I am wondering why it happened...
Did Phusion change the way Passenger is installed with nginx?

On another note: It would be nice for us newbies to describe Passenger and Capistrano and why you are installing them.

Thanks for the guide...
A3ebf58c9ae8646e1ff55f2f2f7a39c4
I had the same issue, Earl. I think the author assumed that by installing the passenger module, nginx would be installed automatically as a dependency. Maybe there's been a change in the repository, but in my case nginx didn't install either, it had to be done specifically with
sudo apt install nginx


8e9f4c54301d8c03cba974b5add15fff

I get the error:

The following packages have unmet dependencies:
libnginx-mod-http-passenger : Depends: passenger (= 1:5.3.4-1~bionic1) but it is not going to be installed
Depends: nginx-common (= 1.14.0-0ubuntu1) but 1.14.0-0ubuntu1.1 is to be installed

When I just followed this. Seems some packages were updated but the requirements on nginx requires the old version?

Ce795239ba5dd2384fc2f88ffaff5451

Hey Daniel,

Looks like there's just a temporary issue with Passenger's package as of last night. They're fixing it but here's a workaround: https://github.com/phusion/passenger/issues/2122#issuecomment-423355568

We ran into the same thing on Hatchbox and the workaround fixes it.


63e68f913916ee056f62c9f4f9674118

I am wondering if there is a variant toturial for the Puma, Nginx and Capistrano setup? Is Puma a less viable app server for production? Can we invoke a small discussion on this?

Ce795239ba5dd2384fc2f88ffaff5451

Something I'll probably add a some point soon now that Puma ships with Rails by default.

Puma is great too, but this tutorial is intended for beginners and Puma requires you to setup, run, manage, and monitor a separate process on the server independent of NGINX. It's just a lot less beginner friendly in production so that's why Passenger is the default. It's much easier to get up and running to learn the ropes and once you've done it successfully you can swap over to Puma if you like.


650f65fd9bf70e51d5284bf99bbfd538

Hello Chris,
it's the first time I'm trying to deploy an app on a server.
for the moment i have 2 problems.
first, optionnal: I don't have secrets.yml, secrets.yml.example and database.yml.example in my rails app. Do I have to create them and if yes what do I put in my secrets.yml (On the other hand, I have credentials.yml.enc and master.key)
secondly, i'm at the first deploy step and every time i run "cap production deploy" that stop at "git:check" with this message :
[email protected]: Permission denied (publickey,password).
01 fatal: Could not read from remote repository.
01
01 Please make sure you have the correct access rights
01 and the repository exists.
I had, beforedeploying, generate a pair of key in the sudo user on the server, I had add this public key to the deploy key section of my repo git. I tried to clone the repo on the server but I have the same message. but on local no problem. Do you have an idea of what I did wrong (I look for a solution on google, I try change the git address and several other things since one day). Did I miss something.
And of course thank you very much, Chris, for this article.

Ce795239ba5dd2384fc2f88ffaff5451

Hey Glory!

Sounds like your server can't authenticate with your git repo. There are two options for this.

  1. You can add SSH keys on your server. Take the public key from the server and add it as a deploy key on your git repo.
  2. Let Capistrano forward your development machine's ssh key to the server and use it to clone your git repo.

I usually use #2.

They outline a bunch of details of this here in the Capistrano docs: https://capistranorb.com/documentation/getting-started/authentication-and-authorisation/

Ce795239ba5dd2384fc2f88ffaff5451

Also, don't worry about secrets.yml. You'll need to symlink master.key on your server though so it can decrypt credentials. You'll go into the shared folder, and create the master.key file and then add it to the list of files to symlink every deploy. That should be all you need for that since the credentials.yml.enc is already stored in your git repo.

650f65fd9bf70e51d5284bf99bbfd538

Hello Chris,
thanks for your answer.
About secrets.yml, I found it.
About git it's exactly the problem. Since the begin I did #1 but as I say that did not work.
So perhaps I've forgoten to do something, or I don't no what. So to be sur i'm going to delete the server and restart all from the beginning. I don't really understand the #2 for git authentication on my server, but I'm going to read the docs you send me, I hope that will works this time.
Thank you again for your work.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 18,000+ developers who get early access to new screencasts, articles, guides, updates, and more.

By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

More of a social being? We're also on Twitter and YouTube.