last day (25 days later) » 

9:18 PM
0
Q: Rails app not appear at a server's IP (just a blank page)

Neon_10I have stucked with production server. Already trying to resolve it for 2 days but do not understand why it happens like this. The problem is: I have tried to deploy Rails application with nginx/unicorn/capistrano. Finally, I got the process working. Nginx and unicorn seem ok on my production ser...

 
Just checked Unicorn log file - it chashes when thying to use a wrong Ruby version...
I have checked: bundle exec ruby -v it showed me that I use ruby version 2.2.2 and bundle exec which unicorn showed that I use 2.2.0, i think this is the problem
 
Is the process actually running? Try ps -ef | grep unicorn. Nginx and unicorn should be set up using unix domain sockets. The blank page may indicate nginx is properly setup but the unicorn proces just isn't running. If you like I've written detailed guide on deploying rails applications with nginx+unicorn. github.com/JensDebergh/guides/blob/master/operations/server/… github.com/JensDebergh/guides/blob/master/operations/server/… github.com/JensDebergh/guides/blob/master/operations/server/…
 
thank you!!!!!!
 
You're welcome, hope it help!
 
@JensD I was going with your guide and have caught an issue which can not resolve, please could you check: stackoverflow.com/questions/30202012/…
 
9:18 PM
Glad you could fix your own problem. I was just looking into it, when I saw your own comment ;)
 
Now I have a problem - nginx server is run, but showes me only a welcome page on my server's IP address. The deploy has finished successfully, but I think there is something wrong with nginx setup...
 
Did you follow all 3 guides ? In one of the guides I override the default nginx.conf which allows multiple sites and virtual servers to be configured. It may be that your nginx server isn't properly configured to proxy towards the rails socket running under /tmp/appname_unicorn.sock
 
yes, I follow them and now have a problem with Unicorn restart: INFO [7c7add6f] Running /usr/bin/env service unicorn_foreignernetwork restart as deployuser@[IP] cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as deployuser@justforeign.com: service unicorn_foreignernetwork restart exit status: 1
it shows a problem in the /etc/init.d/unicorn_... file in this part: test -s "$PID" && kill -$1 cat $PID. I think i can be connected with the :unicorn_pid in the unicorn.rb.erb as i did not find a place where it initiates. Can this variable be missing?
the unicorn can't be started: deployuser@justforeign:~$ sudo /etc/init.d/unicorn_foreignernetwork start /etc/init.d/unicorn_foreignernetwork: line 25: kill: (10813) - No such process master failed to start, check stderr log for details
@JensD as I see the unicorn can't started - there are such messages in the unicorn errors log file: adding listener failed addr=/tmp/unicorn.foreignernetwork.sock (in use) something is conflicting, did you face something similar? Please could you help me?
 
Could you try removing the /tmp/unicorn.foreignernetwork.sock . Kill the unicorn process by ps -ef look at the unicorn master process PID. Use kill -9 [PID]. Afterwards make sure the user you are deploying with is a non root user with sudo rights available over ssh. Try to deploy it again and see what happens. Something may have gotten messed up.
 
Ohhh you are a genius, dude... Brilliant! But I have another problem... everything got back and I have a blank page :)
I have checked my ruby versions (ruby -v, and they are 2.2.2 (rbenv versions shows that is an only verson)), but... in the shared folder I have version 2.2.0: /var/www/foreignernetwork/shared/bundle/ruby/2.2.0/bin/unicorn rbenv which ruby shows /home/deployuser/.rbenv/versions/2.2.2/bin/ruby
bundle exec which unicorn shows /var/www/foreignernetwork/shared/bundle/ruby/2.2.0/bin/unicorn facepalm... and there is only one 2.2.2 in the ~/.rbenv/versions
even if I remove it, everytime sets up ruby 2.2.0 and unicorn is using this Ruby, although is not installed at both server and my laptop either... checking more..
 
 
1 hour later…
10:46 PM
Hello JensD!
Please could you help me? im completely stuck, got back to the initial problem...
 
 
1 hour later…
11:51 PM
oh it seems everything is ok and i needonly set up a secret key =)
 

  last day (25 days later) »