Coder Social home page Coder Social logo

Can't use sockets with rails about puma HOT 10 CLOSED

puma avatar puma commented on April 28, 2024
Can't use sockets with rails

from puma.

Comments (10)

sxua avatar sxua commented on April 28, 2024 3

nginx/1.0.13

Oops, sorry, my bad. nginx logs shows me: *1 connect() to unix://tmp/puma.sock failed (13: Permission denied) while connecting to upstream

chmod a+rw /tmp/puma.sock does the trick

from puma.

thepixelmonk avatar thepixelmonk commented on April 28, 2024

huh ok so I tried puma -b unix://tmp/sockets/puma.sock config.ru, but doesn't seem to be playing well with nginx, just gives me a bad gateway error. works fine if I don't use a socket and just use a custom port.

from puma.

thepixelmonk avatar thepixelmonk commented on April 28, 2024

and my nginx setup works fine with unicorn's sockets.

from puma.

evanphx avatar evanphx commented on April 28, 2024

Was the first attempt calling puma via "rails server"? It looks like it got heavily confused because it's got a port number in there too.

I did just test it using nginx and it seems to work fine. What nginx configuration do you have it? Does the request show up in puma's log at all?

from puma.

sxua avatar sxua commented on April 28, 2024

+1
also tried to pair it with nginx, but all I've got is "Bad Gateway"
this configuration works well with Unicorn, but not with Puma

nginx.conf:

upstream puma {
  server unix://tmp/puma.sock fail_timeout=0;
}

config/puma.rb:

bind "unix:///tmp/puma.sock"
pidfile "/tmp/puma.pid"

running as:

~$ puma -C ./config/puma.rb config.ru
Puma 1.0.0 starting...
* Min threads: 0, max threads: 16
* Listening on unix:///tmp/puma.sock
Use Ctrl-C to stop

from puma.

evanphx avatar evanphx commented on April 28, 2024

I'm still unable to reproduce this issue. What is in config.ru?

from puma.

sxua avatar sxua commented on April 28, 2024

Just default Rails app

require ::File.expand_path('../config/environment',  __FILE__)
run TestApp::Application

from puma.

evanphx avatar evanphx commented on April 28, 2024

What version of nginx are you testing against? Does anything render?

from puma.

evanphx avatar evanphx commented on April 28, 2024

Oh interesting! So it was a permission problem. I'll investigate the proper way to set the perms of a unix socket.

from puma.

xpepermint avatar xpepermint commented on April 28, 2024

Related to this #73

from puma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.