Ask A Question

Notifications

You’re not receiving notifications from this thread.

Deploy Ubuntu 16.04 Xenial Xerus Discussion

Chris Oliver asked in General
Konrad Makowski Konrad Makowski

This is not working on Xenial Xerus because there is no packages for Ubuntu 16.04 in Phusion Passenger repositores yet.

Reply

You can try using the older trusty repository for now while they work up on updating their apt repository:

sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main > /etc/apt/sources.list.d/passenger.list'

Reply
Friendof Afriend Friendof Afriend

After changing database.yml and secrets.yml to examples, whenever I run Rails s for running server. I get error and it complains that it can't find the yml files and server will not get started. What can I do?

Reply

Chirs this video is great !!!
would you please publish a similar video with deploy rails on unicorn and nginx with good explain about the config!
thanks )

Reply

Edit /etc/nginx/nginx.conf file and uncomment #include /etc/nginx/passenger.conf;
For example, you may see this:
include /etc/nginx/passenger.conf;
after this:
sudo service nginx restart

and final check if passeger work:
sudo /usr/bin/passenger-config validate-install

Reply

do you see the message "Restarting nginx nginx" when you type "sudo service nginx restart" ? In my case I don't see it and Chris said that something gonna be wrong if you don't see it.

Reply

Hi Chris, when I do sudo service nginx restart it doesn't show anything, you say that this might be an error, I did sudo tail /var/log/nginx/error.log but I can't see any error there! this is the output :

[ 2016-07-09 12:46:04.5741 23679/7f3c412f4700 Ser/Server.h:464 ]: [UstRouter] Shutdown finished
[ 2016-07-09 12:46:04.5743 23679/7f3c47f47780 age/Ust/UstRouterMain.cpp:523 ]: Passenger UstRouter shutdown finished
[ 2016-07-09 12:46:04.5939 23674/7f3bb0d6f780 age/Cor/CoreMain.cpp:967 ]: Passenger core shutdown finished
2016/07/09 12:46:05 [info] 23783#23783: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:75
[ 2016-07-09 12:46:05.7251 23790/7f341ddf1780 age/Wat/WatchdogMain.cpp:1291 ]: Starting Passenger watchdog...
[ 2016-07-09 12:46:05.7624 23793/7fdc2184b780 age/Cor/CoreMain.cpp:982 ]: Starting Passenger core...
[ 2016-07-09 12:46:05.7625 23793/7fdc2184b780 age/Cor/CoreMain.cpp:235 ]: Passenger core running in multi-application mode.
[ 2016-07-09 12:46:05.7646 23793/7fdc2184b780 age/Cor/CoreMain.cpp:732 ]: Passenger core online, PID 23793
[ 2016-07-09 12:46:05.8046 23798/7f724a019780 age/Ust/UstRouterMain.cpp:529 ]: Starting Passenger UstRouter...
[ 2016-07-09 12:46:05.8060 23798/7f724a019780 age/Ust/UstRouterMain.cpp:342 ]: Passenger UstRouter online, PID 23798

by the way when I opened /etc/nginx/nginx.conf the first time, I haven't find the lines passenger_ruby and passenger_root

Reply
ChaosPredictor ChaosPredictor

Hi, have the same issue can't find solution in any web.
Did you found something?

Reply
Dylan Huang Dylan Huang

Hi! I had that same problem and the solution for me was to comment out this line in my /config/environments/production.rb file:

"config.force_ssl = true"

What was happening was that each time you connected, the rails application forced you to redirect to "https" for SSL but your SSL cert is not setup yet!

Reply

Chris, Thanks so much for this tutorial. I followed along and was able to get this all working on a VirtualBox setup. However a problem i encountered was a bundler error. i had to SSH into the server and use 'which bundler' and add that path into the :default_env in deploy.rb
FOR THOSE WITH THIS ERROR:
set :default_env, { path: "/home/deploy/.rbenv/shims:~/.rbenv/bin:$PATH" }

My question after this...Is there an easy way to run custom rake tasks, once deployed?

Thanks

Reply

After following this tutorial, I'm still getting the default "Welcome to nginx" page

Reply

You'll need to restart nginx again to get the site up and running.

Reply

The Capistrano part of this tutorial is quite out of date. See http://stackoverflow.com/a/...

I'd be happy to help rewrite that part if needed.

Reply

Thanks for this very helpful tutorial, everything works as expected, except for my assets... some of my images aren't showing up in the browser, but they get deployed... I´m not sure what to do... I've been googling around and don´t seem to find a solution

Reply

Make sure you're using these helpers for your static assets: http://api.rubyonrails.org/...

Reply

After installing NGinx it is necessary to set up and activate the firewall - otherwise you won't see even the Nginx start page. See https://www.digitalocean.co...

Reply

When I use rbenv and launch "cap production deploy" I get an error: "LoadError: cannot load such file -- capistrano/rbenv". On the local computer I use RVM and I want to set up rbenv on the remote one. Perhaps it is not possible? Do I have to have rbenv on the local computer installed?

Reply
Cristian Georgescu Cristian Georgescu

Newbie question here. I followed the tutorial and I have the rails 5 app on server.
I bundle install everything but when trying to start rails (rails s -e production) I get the rails new prompt ....like I need to create a new rails app. Any tips on how to start it or what I might be missing ?

Reply

You don't need to run Rails, Passenger will start the app for you automatically, that's why we set it up this way so you don't have to manage running scripts. It's automatic.

Reply

I had to Generate RSA SSH Keys to make things work. The command is "ssh-keygen". See http://www.cyberciti.biz/fa...

Reply
Jorg Dominguez Jorg Dominguez

Hi there!

I have a issue here: No Rakefile found (looking for: capfile, Capfile, capfile.rb, Capfile.rb, /usr/lib/ruby/vendor_ruby/Capfile)

What should I do?

Reply

You should run it in local

Reply

Great tutorial. Everything went well, but when I do cap deploy production, I get the error below. Any ideas? Thank you!

cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@redacted: passenger-config exit status: 1
passenger-config stdout: Nothing written
passenger-config stderr: *** ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it
is running, then the causes of this problem could be one of:

1. You customized the instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's
passenger_instance_registry_dir option, or Phusion Passenger Standalone's
--instance-registry-dir command line argument. If so, please set the
environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory
and run this command again.
2. The instance directory has been removed by an operating system background
service. Please set a different instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir
option, or Phusion Passenger Standalone's --instance-registry-dir command
line argument.

Reply

I had the same issue, I had missed to uncomment "include /etc/nginx/passenger.conf;" and server_name was not proper. after fixing them its working

Reply
David Jarillo David Jarillo

yes I had the same issue, any solutions?

Reply

Getting the same issue -- anyone solve?

Reply

I had the same issue , anyone knows please

Reply

Almost there but when I run `cap production deploy` I get

```
00:00 rbenv:validate
rbenv: 2.3.1 is not installed or not found in $HOME/deploy/.rbenv/versions/2.3.1

```

Is cap checking this on my local machine or the server? I have changed the path to just `$HOME/.rbenv` and still get the same issue.

Reply

Fixed this as per this SO page. http://stackoverflow.com/qu...

Reply

Also getting an error `There are no Phusion Passenger-served applications running whose paths begin with '/home/deploy/app_name'`. app_name is replaced with the name of my app.

Seems there is another user getting this problem as well.
http://stackoverflow.com/qu...

Reply

hey Jay, did you end up solving this issue?

Reply

Thanks Chris for this video! How do we setup password authentication, if we're using this tutorial to deploy a staging version of the site? I've setup everything via this site https://www.digitalocean.co... and yet it's not asking for passwords upon entering the site.

Reply

Hmmm, double check that you restarted nginx and that went correctly. If so, it should pick that up.

Reply

Maybe I missed it in the tutorial, but I had to authenticate the DigitalOcean server with GitHub (by creating a SSH key from the server). Capistrano deployment failed until I did that, as the server was denied access to the Git repository.

Reply

I get a 'Permission denied (publickey) fatal: could not read from remote repo' when I 'cap production deploy'. The same keys are on DigitalOcean and Github. Pushes to github works fine. I can ssh into the digitalocean server as root or deploy users fine too. Anyone know what I've missed?

Reply
I'm getting the same prob. Did you find a fix?
Reply
Fixed by running 'ssh-add' on local machine.
Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,168+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.