Question

Rails one-click (16.04) problem with unicorn.sock not found

I’m trying to setup my Rails app onto the new one-click install using Ubuntu 16.04. I was trying to set Let’s encrypt when I realize the server did not work and the nginx log show me this:

2017/06/15 10:49:17 [crit] 3304#3304: *1 connect() to unix:/run/DigitalOceanOneClick/unicorn.sock failed (2: No such file or directory) while connecting to upstream, client: x.x.x.x, server: staging-api.batiment.nc, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:/run/DigitalOceanOneClick/unicorn.sock:/favicon.ico", host: "staging-api.batiment.nc", referrer: "http://staging-api.batiment.nc/"

Checking at the /run folder, it seems that DigitalOceanOneClick directory is erased somehow. Whenever I create it, something erase it.

Here are the thing I did on the machine (the rails_project demo page was working fine before):

  • Use rvm to change Ruby version (was 2.4.0 but needed to change to 2.2.5)
  • Install my app and its dependencies (every worked out)
  • Point unicorn to the right directory (the new app)
  • Configure nginx to point to the right directory and start let’s encrypt but then it failed to find well-known... public URL

Anyone of you experiencing that?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I’m running into the same issue too.

2018/04/05 23:29:19 [crit] 1501#1501: *15 connect() to unix:/run/DigitalOceanOneClick/unicorn.sock failed (2: No such file or directory) while connecting to upstream, client: X.X.X.X, server: _, request: “GET / HTTP/1.1”, upstream: “http://unix:/run/DigitalOceanOneClick/unicorn.sock:/”, host: “192.241.169.48”

For me the solution was to bundle install --deployment so the unicorn server is installed in the vendor folder of the new rails project. And then you need to point the paths in the .unicorn.sh file to the correct place. In my case there where to extra folders added to the path. /ruby/2.4.0 was created inside vendor/bundle so in .unicorn.sh change to: export GEM_HOME=“/home/rails/project/vendor/bundle/ruby/2.4.0” and so on for the other paths too.

Hope it helps!

Same issue.