Deploy Ubuntu 14.04 Trusty Tahr Discussion

The following commands should be slightly modified:cap install STAGES=productioncap production deploy

I believe it should be the following:bundle exec cap install STAGES=productionbundle exec cap production deploy

If you run 'cap' directly from the shell, it searches standard linux PATH and says that cap is not installed.In other words, the binary is in gems folder ( ~/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-3.1.0/bin/cap ) and should be called with bundle exec.

At least that's what I found out trying to replicate the installation.

I believe, if you run rbenv rehash after installing the capistrano gem, the executable should become available without having to run bundle exec. I could be wrong, but that's also the same way that gets the rails command available.

Thanks for this guide, it's my first time trying to deploy an app in rails. With a little help from google and stackoverflow I managed to set it all up and finally created a db, but when I visit my site in the browser I get an error page. It says to check my log file in var/log/nginx but when I try to go there it says:-bash: cd: nginx: Permission denied

Any idea how I can see the error log? and also do I maybe need to do anything else not mentioned in this guide to get the site live?

It looks to me like it cannot find your version of Ruby. Did you modify your nginx config to point to the correct location? Basically, it is saying that /home/deploy/.rvm/bin/passenger_ruby is not a valid ruby executable.

If you are using rvm, you'll want to set passenger_ruby to something like this

passenger_ruby /home/deploy/.rvm/rubies/ruby-2.1.2/bin/ruby

Change you ruby version accordingly. You can always cd into these folders to verify what is available.

It appears I never gave an example for rvm, so sorry on the confusion.

You've set the `PassengerRuby` (Apache) or `passenger_ruby` (Nginx) option to '/home/deploy/.rvm/rubies/ruby-2.1.2/bin/ruby'. However, because you are using RVM, this is not allowed: the option must point to an RVM wrapper script, n

ot a raw Ruby binary. This is because RVM is implemented through various environment variables, which are set through the wrapper script.

To find out the correct value for `PassengerRuby`/`passenger_ruby`, please read:

actually, it looks like that failure is fine.. however when it's trying to mirror my git repo it's giving me this error: fatal: destination path 'home/deploy/codeblog/repo' already exists and is not an empty directory. When i ssh into the server and look at the file structure that folder isn't there.

Try changing it to passenger_ruby /home/deploy/.rbenv/shims/ruby; and restarting nginx to see what happens. I think pointing directly to that version of Ruby should work, but I've also always just pointed it to the shim.

Having had a similar issue, it seems that the answer is not to use the output for 'which ruby' when using RVM.

The output left in /var/log/nginx/error.log told me:

You've set the `PassengerRuby` (Apache) or `passenger_ruby` (Nginx) option to '/home/deploy/.rvm/rubies/ruby-2.1.2/bin/ruby'. However, because you are using RVM, this is not allowed: the option must point to an RVM wrapper script, not a raw Ruby binary. This is because RVM is implemented through various environment variables, which are set through the wrapper script.

To find out the correct value for `PassengerRuby`/`passenger_ruby`, please read:

Hmm, looks like it's similar issue. One last suggestion from my server that I have running apache instead of Nginx (but still uses Passenger) is to use this for passenger_ruby:

passenger_ruby /usr/local/rvm/wrappers/ruby-2.1.2/ruby

It's possible the wrapper helps it load the proper version. This is one of the problems with rvm in the sense that it integrates almost too much with your environment causing it to be a headache to set up at times.

Well, it's saying that you should update your config/secrets.yml to include a section for production. You can either set it up in the file and commit it, or you can remove it from git and set it up to link the file on deploy just like your database.yml

That's okay because it is just cloning the repository. It looks like the symlink is crashing possibly because /home/deploy/gymsight/shared/config/database.yml doesn't exist. Have you double checked that file exists?

The repo helped me work through most of the problems. Just need to clarify one thing now. In the database.yml file the username should be "postgres" and the password is the password we entered when we created "postgres"? I'm able to sign into the user fine if I "su postgres" but when I use those credentials in the database.yml file to create a DB, after signing back into deploy, I get the error FATAL: password authentication failed for user "postgres".

I want to add a helpful tip incase anyone else's Rails app has SSL enabled and is not working.

If you have enabled SSL/https on your Rails app, you will need to add another step to this process. I went through this tutorial and was getting ERR_CONNECTION_REFUSED in chrome when I tried to get to my site. I am new to this and it took me hours before I realized what the problem was.

Soon i would like to write a deployment guide for opensource project https://github.com/sharetri... from non-server guy perspective. And this guide playing a big role, i hope you wouldn't mind that i will reference it via link?

Hey, thanks a lot for this tutorial. This is one of the most comprehensive one that I've come across thus far!

I am running into some trouble however. For some reason, the app that is actually up and running on my server is an older version (from like two months ago) of my application, but the "current" version of the app is my desired up-to-date one. (I see this when I review the code in that directory.)

I've specified that the master branch should be deployed, restarted the web and app servers, precompiled assets. But, I still have this older version running. (I am having the same problem this person had http://stackoverflow.com/qu...

One thing is to check and make sure your config points to the right directory. It definitely has happened to me before, but it is almost always a case of either reading the wrong config or the config pointing to the wrong folder.

For anyone reading this if your site looks like an older version of your site, it might just be that your assets are not loading properly.

It turns out that my custom stylesheet was not actually loading, and there was an error in the precompilation of assets because of this.

One way to check for that is by (if you're using chrome) go to a page on your app, open the inspect tool (ctrl + i), go to the network tab, refresh your page. Look for any red links (stylesheets or assets that are not loading). This is a problem with your code not capistrano. The code for loading specific stylesheets was working on my local machine, but it didn't work in production. So double check that. :]

Hey Chris, thanks for providing this walkthrough, it's been mostly a breeze. One thing I'm stuck on however is generating the database. When I run RAILS_ENV=production bundle exec rake db:create in the /home/deploy/myapp/current directory, substituting "myapp" for the actual name of my app or course, the vps tells me ruby 2.1.1 is not installed, so I install it, then it wants me to bundle install, and so I do, and finally I'm stuck with "Gem::Ext::BuildError: ERROR: Failed to build gem native extension." type errors as the gems fail to compile. Where did I go wrong? I'd be happy to supply much more insight into this issue, up to and including access to the vps! thanks in advance.

Hi,Thanks for the tutorial. I'm having trouble uncommenting the /etc/nginx/nginx.conf file. It says I have read only permission and cannot edit it, even though I followed the previous steps of setting the permissions. How do I fix this? Thanks again.

Get rid of the keys line in ssh_options. You have to login to the server with your local ssh key, not your remote user's key. It will do this by default and same with auth_methods. You can leave forward_agent but can get rid of the rest.

Depends on what you want to do, but generally Passenger is quite good on all fronts. You can read some more about some performance testing but no matter what, it isn't going to be definitive that one is always better than another. https://blog.engineyard.com...

Don't specify the keys option there. Your local key in ~/.ssh/id_rsa will be tried against the server's /home/deploy/authorized_keys file. Capistrano won't allow password authentication, so you must make sure you ran the ssh-copy-id to add your pub key to the server deploy user's authorized_keys file.

The first one. It's saying it can't ssh into domain.com as the deploy user. When you ssh in manually with ssh [email protected] that should connect without asking you for a password. That works correctly?

Hi guys, great tutorial. :)I did it exactly the same way like described here prior to reading it and wrote a blog on how to install rbenv globally for all users. Check it out here: http://toschas.com/rbenv-se... .

I'm able to SSH into my remote server without entering the deploy user's password, so I'm not really sure where else to tweak. My stackoverflow searching hasn't really turned up any easy solutions. I'd appreciate any thoughts that worked for others.

I get lost at the nginx.conf part. After editing the file and do a restart I get a [fail] message which I suspect ain't a good thing. When I do which ruby I get /home/deploy/.rvm/rubies/ruby-1.9.3-p547/bin/ruby. (yes i am doing 1.9.3)

Hi, I am proceeding along with the tutorial, after reading it thoroughly. I find it confusing that the user name is 'deploy' when that term overlaps with Capistrano-installed file and folder names. I used 'deployer' (user) to discriminate from 'deploy' (action). I know this is just a nit, but it cost me some time.

I am deploying to a headless server on my LAN, so I skimmed through the Droplet stuff.

Very nice tutorial, it worked for me the first time (with hardcoding the secret and database password). One thing I missed was environment variables, as they are also an important part of deployment. I tried to deploy another project using environment variables, but I couldn't get it to work.

I spend hours looking around on how to get environment variables to work. I used rbenv on my server which needs the 'rbenv-env' plugin. I didn't realize after a few hours that I needed this plugin to get my environment variables to work.

It would be nice to see it added to this tutorial. I am sure others have had problems trying to figure out what the right/easiest way is to achieve this.

Definitely a pain in the butt! I think my personal suggestion for most people is to use Rails' secrets.yml and symlink that on deploy just like database.yml. It works just like environment variables more or less and is builtin to Rails.

Chris - can you elaborate on this or point me to a tutorial on setting this up? I had done this with ENV variables but after my last VPS reboot they all seemed to be lost and I can't recall how I set them before.

I ran `ssh-copy-id [email protected]` and I'm able to SSH into the VPS without having to put in a password, however, when I run `$ cap production deploy` I get this error:

[ecc89106] Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.DEBUG[ecc89106] Permission denied (publickey).DEBUG[ecc89106] fatal: Could not read from remote repository.DEBUG[ecc89106] DEBUG[ecc89106] Please make sure you have the correct access rightsDEBUG[ecc89106] and the repository exists.DEBUG[ecc89106] Finished in 0.742 seconds with exit status 128 (failed).cap aborted!SSHKit::Runner::ExecuteError: Exception while executing on host xxx.xxx.xxx.xx: exit

I only have `authorized_keys` and `known_hosts` within /home/deploy/.ssh/. Do I need to manually copy over my public/private keys as well?

Thanks for the really clear tutorial. I have however had difficulty getting all of the way through to a working deployment. A couple of points that threw me or might need further clarity are as follows (working with rbenv):

1. The createuser --pwprompt should I believe be createuser [user name] --pwprompt

2. When running the cap commands I need to prefix with bundle exec.

3. The Capistrano section is all run locally, not on the server.

This gets me through to the stage where I deploy, however on running the

I do seem to get past this stage by manually performing sudo apt-get install bundler. However that doesn't seem the right approach to me and when successfully deployed after that I get a passenger error as follows:

You want to run gem install bundler to get the appropriate version on your server. apt-get for any ruby related things is bad with this set up because you'll get conflicting things going on (or at least confusing things).

I followed your tutorial but after deploy and putting the IP of the server to the browser I get a message "We're sorry, but something went wrong." I did asset precompile and db:migrate either. I also tried to run the app with webrick on port 3000 and it went all fine. My nginx log file is empty. What do you suggest?

You don't have to run it manually like you do in development. When you run Capistrano, it runs bundler which installs the Rails gem. Then, Nginx is always running and it fires up Passenger which starts your Rails app for you. So basically Nginx is the thing that runs your Rails app in production and all you need to do is make sure Nginx is running.

Thanks for your tutorial! but I have one problem with ssh key. When I trying to deploy I had error with ssh key. The problem is that if I authenticate to server via [email protected] it goes via ssh keys but when I try with deploy user it prompts me the password. Should I write deploy's password somewhere like production.rb or do you have any solution? I am very new at deploying projects so any help may help me. Thanks

The goal is not to use passwords for ssh so it is more secure. You'll just need to copy your ssh public key to the deploy user with ssh-copy-id. Double check that you can ssh into deploy without a password so Capistrano can too.

Ooh, thanks a lot ! Finally I uploaded my project. And run touch myapp/current/tmp/restart.txt , it created file but it seems didn't restarted. What should I do?Or should I run bundle exec rails s in current folder and add to IPADDRESS:3000?

Is there a tutorial that I'm missing for this? I guess I will try with one of my rails apps but if someone could provide me a link to the tutorial on how to build this app or explain this part about the Gemfile to me that would be great( I know what a Gemfile is, just not in context to the tutorial)

Yep, pretty much the same thing aside from they connect you differently with .pem keys instead of a password to login initially. May also have to open up the ports to the outside world so you can server HTTP requests.

Yep. You can set it up to do a git push like Heroku does, but I've never set a server up that way before so you'll probably need to do some digging to figure out how to do it. Check out this: https://www.digitalocean.co...

I'm having trouble at the step of installing Ruby with rbenv. rbenv installed fine but when I run rbenv install 2.2.0 it hangs (not really hangs, I can see stuff happening if I use the --verbose flag), and then I get the following:

Used only a portion of this tutorial; using rbenv to install ruby version 2.1.3; i was having problems installing mechanize gem. The part where you showed how to setup ruby using rbenv benefited me. Excellent tutorial

I went through the tutorial. I had a few issues but managed to get through it. However now that I have finished it. It looks like the rails application is not actually running. There are no log files in 'myapp'/log (I am not sure where they logs would be). When I go to the IP address for my server all I see is the welcome to nginx. I am not sure if there is supposed to be another url I go to instead.

I am guessing that I need to do "cap production deploy" every time I make a change. But doing so wipes away the secret key I set in shared/config (like database.yml I just did a symlink to current/config)

My pg_hba.conf has everything in trust mode, so this should work. When I switch the pg_hba.conf over to password or md5, and put a password in the database.yml file, I get an error that no password was provided; even though I've provided one. I noticed someone else had an error like this down in the comments, but there was not a resolution posted. Is this something you are familiar with?

HAHA! After switching everything to blank password string and trust, and rebooting the server, the site just loaded up for me. I'd restarted the rails instance, as well as postgres service, but I guess that wasn't enough. This leads to the next question of getting this to work with a password or some other more secure method; luckily this deployment is only for an intranet site.

Users using the RVM method need to execute this command after 'source ~/.rvm/scripts/rvm' -- 'echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc'; otherwise if you exit the terminal session and log back in it will not be loaded. If you are getting a message that 'rails' isn't an installed gem this is likely the cause I would think.

I don't get this and it's getting infuriating. I go to my site folder, cd to current, run "rails c" and I get:

WARNING:root:could not open file '/etc/apt/sources.list.d/passenger.list'

The program 'rails' can be found in the following packages:

* ruby-railties-3.2 * ruby-railties-4.0

Try: sudo apt-get install <selected package="">

So I put source ~/.rvm/scripts/rvm and run rails c again. Same result. I cannot get the effing console to start and I'm about to lose my cool. I'm going on 2 hours wasted on this and it's absolutely infuriating.

Can the guide be updated with how to correctly handle the production database.yml and adding the secret_key as an environment variable for for nginx? It is also a bit unclear about at what point are we cloning the repo to the machine vs what is committed to the repo.

Always the file named Gemfile in the root of your Rails application. It's the defining list of dependencies for each Rails app. You save it in each app so that all of them can use different versions without fighting each other.

Most of my projects are private and I put them on Github (paying for private repos) and you could easily store them privately on Bitbucket. In either case, your Capistrano URL will securely authenticate with Github or Bitbucket using your SSH key to check out the code. It logs in using that so you don't need to use a password to clone the code on a deploy.

Hi! I followed all the tutorial and everything is working fine. The only thing I cannot do and I would like to be able to do is to run rails console on the server. When I run 'RAILS_ENV=production bundle exec rails console' in the /current folder it looks like there isn'n a rails project. I'm missing something in the command? How can i get the console working? Thank you

Since the ./bin directory is version controlled in Rails 4, we need to prevent Capistrano from linking it on deployments by removing bin from set :linked_dirs. Now in order to prevent bundler from overwriting the version controlled binstubs, we can add the line set :bundle_binstubs, nil which will prevent capistrano-bundler from setting the --binstubsoption when running bundle install.

Should also be changed in the guide maybe?! Hope this helps and thank you Chris for your help!!

Please update the guide with Michel suggestion!, few days ago I followed the guide, nice guide, everything is fine. But today, I needed the console and it is not working. I lost a lot of time searching the web, but the answer was here, at Micahel's answer.

Thank you for step by step process. I ended up with 403 forbidden error at the end. Could you shed some light on what might have went wrong. I posted it on stackoverflow as well but nothing is working. http://stackoverflow.com/qu...

I've tried to follow your steps with true care, but for some reason my Nginx is jinxing me :(I just can't figure out what to do.. just a starting developer alone in the scary world of deployment. Could you maybe help me for a few minutes, for I am sure you are a true pro.Capistrano seems to be connected, but presents us with an ssh error; permission denied.There's also a problem with nginx: sudo service nginx restart presents me with FAIL, I've tried nginx -t, which presents me with a few errors, though sudo nginx -t says everything is fine.

Great tutorial, Thanks! I had the same issue as @disqus_sRbyuMSsk1:disqus . I also always forget that I need to create the secrets.yml values in production. It would be great to see a section about adding environment variables in the future.

I believe there is a gem that does that for you; however, I find it much simpler just to export the environment variables I need into my shell's rc (.bashrc or .bash_profile if you're using bash) then just refer to them in my database.yml and secrets.yml. Hope this helps.

I have gone through all the process and cap production deploy become successfull, but at visiting my IP address, i am getting message "We're sorry, but something went wrong(500)"Please suggest me what to do, i have already spend my 3 days to solve it.Thanks.

Its one of two things: 1- You have not specified your git repository correctly in capistrano's deploy.rb2- You didn't add your VPS ssh public key to your github key chain for passwordless deployment https://help.github.com/art...

I have just automated the process of setting up a production server for Ruby on Rails production application. It includes Nginx, Redis, Memcached, Ruby with RVM, Unicorn or passenger, Mysql or Postgresql.It uses Chef, knife solo and librarian. No need to be afraid, they are simple commands for you. Hopefully it can some of you to cut on time they spend for server setup.

Thanks for sharing Shebaz! Part of the reason I don't link to an automated process is because I want people to learn and understand how to setup their machine. It's good to be familiar with all the tools and their configurations. These automated scripts are perfect after you're familiar with the basics! :)

I totally agree with you Chris. I have written it after reading many articles like yours. It not for learning but for people who are already familiar and perform this task regularly. Its just to avoid repetition. THanks

Thank you very much gorails.com I succesfully installed rvm on my ubuntu 14.04. This has been a night mare for me, installing rvm correctly.I couldn't find a good how to guide on this not until i stumbled upon gorails.com. I now bookmark this site and joined the mailing list so i can also share with others not in this group.

1. You accidentally pasted your password into this (I edited it out), but you'll want to go change that now.

2. It sounds like your SSH key is not added to Github. It's connected to the server and now needs to ask Github for your code so that it can put it on there. That step has failed and so you'll want to make sure that your ssh key is added to your user account on Github.

Awesome tutorial Chris Oliver very detailed and well explained. I managed to get the server up and running. However, I have one hiccup, after I run cap production deploy some of my assets do not show up. Some images appear, others don't and when viewing the webpage on mobile it seems the css doesn't work as well ( showing the desktop site when view from mobile ). Any idea why this may be so?

The following are two logs that appear in red when cap production deploy is run:

The one thing I might think of is that you want to make sure you're using ERb asset_url helper appropriately to reference your images. If you're using those through CSS, you can use the "asset-url" helper in your CSS. The urls that are used in production have different URLs than in development so you have to use these helpers.

Forgot to leave my resolution. Thanks for the adice @Chris, got me started in the right direction. I had added some files to the vendors folder so I had to make sure that they were being linked properly. Thanks again.

Hi there, Soiunds like you are trying to continue development using your production server. You will want to continue development on your local machine, checking the files into version control and deploying when needed. Hope this helps!

You mention that Capfile should include `require 'capistrano/rails'`. However the base cap installation has commented out ` # require 'capistrano/rails/assets' # require 'capistrano/rails/migrations' ` What is the delta between these two options?

In production I typically use Passenger because it has really great performance. You can also use thin but you'll have to set it up differently than I've laid out here. Check out some things like this: http://www.rackspace.com/kn...

This has been a great help, but I am totally stuck now. Every time I manually create the database on the server as you suggest, it is created successfully. However, when I try to connect to it with my deploy user, it tells me the database does not exist. But if I login as the postgres user, it is there. What am I doing wrong, and how can I fix it?

Sweet...thanks Chris!:) FYI creating my second droplet on Digital Ocean. Going to see how difficulty it will be to manage my own servers...two reasons 1. Cost (cheaper and faster with SSD) 2. With you instructions, it seems easier to get something up and running and I get more granular control over the environment...been having issues with other hosting services. Security is the one major area of concern going forward. Also, is there a good service or app for monitoring (like when the app goes down)?

For security, there's a few things you can do like setup a firewall and only open port 80 or 443 for web, setup fail2ban, and disable password authentication over SSH. You'll want to be careful not to lock yourself out of the server, but the recovery console can still let you in if you do. :) More stuff to checkout https://wiki.ubuntu.com/Bas...

Pingdom is probably the most used one, but there are a bunch if you search for monitoring. I use Pingdom's free service I think.

This is a fantastic article that I have used to deploy over 5 applications! Thanks so much for iwriting it!! I find that the postgres createuser command is a bit old and since postgres no longer prompts for options by default.. I find it works better with

Hello I am trying to install Fedena School ERP using Nginx and Capistrano. I have managed to get Nginx running but now I am completely confused, I really don't know where to go from here; the entire Capistrano process makes me confused. Also, I already have my app folder locally and not on git.Please I need help on this please.

: Could not spawn process for application /home/deploy/india_boulevard/current: An error occurred while starting up the preloader. It exited before signalling successful startup back to Phusion Passenger.

rbenv: version `2.1.2' is not installed (set by RBENV_VERSION environment variable)

I found this fix, which worked for me:

set :rbenv_path, '/home/deploy/.rbenv/'

The source said to add it to deploy.rb or it wouldn't work. Sure enough, you can't add it to the Capfile like the other rbenv settings. Not sure why. I'm posting in case it helps others, and for the next time I read this article to setup a server :)

Thanks Chris for this informative tutorial. Two questions here. What should I do if I don't want to use github or bitbucket etc? I just want to develop locally and upload to the server using ssh, ftp etc. Another question is that is it possible to deploy multiple Rails apps in a single VPS in the configuration described in your tutorial? Thanks.

Hi i am unable to run my rails application in production mode. I am using AWS EC2 and in development mode it is working fine but in production mode it give me error "Incomplete response received from application" I searched it on google but didn't find any proper solution yet.

Hello,Chris for thirst, thx for that great article. It would be great if you write few words about scalling up application into many passenger workers. I couldn't find any good and easy to understand tutorial how to do that on custom vps instance.

Yeah! I will do that. Generally with an individual server you want to set the number of workers equal to the number of CPUs on your VPS. Digital Ocean will show you how many CPUs you have on your machine in their dashboard and you can configure that workers variable and restart nginx to make that work.

Hello @excid3:disqus ! Thanx for tutorial! I faced with problem that I trying to solve at least 4 hours..When I create user for Postgres it returns me the next error:

createuser: could not connect to database postgres: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Even though I have to admit that I haven't watched the full video, this seems to be a great resource for a lot of people to learn how to deploy your Rails application on a production server – so first of all, big thanks for publishing it and helping a lot of Rails developers!

However, judging from the comments, quite some people seem to have their problems in getting everything to work.

I do not know if this will be considered a shameless plug but since my whole business is about running Rails applications in production, I want to point everyone who has made it through this tutorial to https://efficientrailsdevop... – a book about managing your Rails environment with Ansible. It will be of great value if you are looking for a more controlled and reproducible approach to provisioning and deployment.

Hi, i'm pretty new to rails and discovered your site with this guide. I followed all the steps until the "cap production deploy" that gave me this error : (cap production deploy --trace) - Im using cloud9 online IDE to follow this guide.

No actually. Since you've got Bundler, Capistrano will run "bundle install" on deploy and will install Rails for you. That's the nice part about it, since you have Rails inside your Gemfile, Capistrano will automatically install it!

After doing everything right, and destroying almost 10 droplets. I keep getting this error.

We're sorry, but something went wrong.We've been notified about this issue and we'll take a look at it shortly.

The Phusion Passenger application server encountered an error while starting your web application. Because you are running this web application in staging or production mode, the details of the error have been omitted from this web page for security reasons.

Please read the Passenger log file to find the details of the error.

Alternatively, you can turn on the "friendly error pages" feature (see below), which will make Phusion Passenger show many details about the error right in the browser.

To deploy multiple Rails apps to the same server, you will need to replicate the capistrano settings for the second app, create another database, and change the default file in /etc/nginx/sites-enabled like the following:

Hi Chris. I followed your tutorial point to point and implemented 3 times in 2 days. But I don't seem to fix this nginx 403 forbidden error. I changed permissions. I tried many solutions on stack over flow on the same or similar issue. But nothing seems to work. Could anybody please tell me what might be the issue. I ll be attaching my stackflow thread here to follow up. http://stackoverflow.com/qu.... Please help needed.

Hi, great post ... I have already a ruby on rails webapp on Ubuntu 14.04 in my case I want update my Ubuntu Server version -> Ubuntu 16.04 so for that topic exists somewhere a best practice or somebody want share any advices ...? thank you in advance ...