Coder Social home page Coder Social logo

puma-dev's Introduction

Puma: A Ruby Web Server Built For Parallelism

Actions Code Climate StackOverflow

Puma is a simple, fast, multi-threaded, and highly parallel HTTP 1.1 server for Ruby/Rack applications.

Built For Speed & Parallelism

Puma is a server for Rack-powered HTTP applications written in Ruby. It is:

  • Multi-threaded. Each request is served in a separate thread. This helps you serve more requests per second with less memory use.
  • Multi-process. "Pre-forks" in cluster mode, using less memory per-process thanks to copy-on-write memory.
  • Standalone. With SSL support, zero-downtime rolling restarts and a built-in request bufferer, you can deploy Puma without any reverse proxy.
  • Battle-tested. Our HTTP parser is inherited from Mongrel and has over 15 years of production use. Puma is currently the most popular Ruby webserver, and is the default server for Ruby on Rails.

Originally designed as a server for Rubinius, Puma also works well with Ruby (MRI) and JRuby.

On MRI, there is a Global VM Lock (GVL) that ensures only one thread can run Ruby code at a time. But if you're doing a lot of blocking IO (such as HTTP calls to external APIs like Twitter), Puma still improves MRI's throughput by allowing IO waiting to be done in parallel. Truly parallel Ruby implementations (TruffleRuby, JRuby) don't have this limitation.

Quick Start

$ gem install puma
$ puma

Without arguments, puma will look for a rackup (.ru) file in working directory called config.ru.

SSL Connection Support

Puma will install/compile with support for ssl sockets, assuming OpenSSL development files are installed on the system.

If the system does not have OpenSSL development files installed, Puma will install/compile, but it will not allow ssl connections.

Frameworks

Rails

Puma is the default server for Rails, included in the generated Gemfile.

Start your server with the rails command:

$ rails server

Many configuration options and Puma features are not available when using rails server. It is recommended that you use Puma's executable instead:

$ bundle exec puma

Sinatra

You can run your Sinatra application with Puma from the command line like this:

$ ruby app.rb -s Puma

In order to actually configure Puma using a config file, like puma.rb, however, you need to use the puma executable. To do this, you must add a rackup file to your Sinatra app:

# config.ru
require './app'
run Sinatra::Application

You can then start your application using:

$ bundle exec puma

Configuration

Puma provides numerous options. Consult puma -h (or puma --help) for a full list of CLI options, or see Puma::DSL or dsl.rb.

You can also find several configuration examples as part of the test suite.

For debugging purposes, you can set the environment variable PUMA_LOG_CONFIG with a value and the loaded configuration will be printed as part of the boot process.

Thread Pool

Puma uses a thread pool. You can set the minimum and maximum number of threads that are available in the pool with the -t (or --threads) flag:

$ puma -t 8:32

Puma will automatically scale the number of threads, from the minimum until it caps out at the maximum, based on how much traffic is present. The current default is 0:16 and on MRI is 0:5. Feel free to experiment, but be careful not to set the number of maximum threads to a large number, as you may exhaust resources on the system (or cause contention for the Global VM Lock, when using MRI).

Be aware that additionally Puma creates threads on its own for internal purposes (e.g. handling slow clients). So, even if you specify -t 1:1, expect around 7 threads created in your application.

Clustered mode

Puma also offers "clustered mode". Clustered mode forks workers from a master process. Each child process still has its own thread pool. You can tune the number of workers with the -w (or --workers) flag:

$ puma -t 8:32 -w 3

Or with the WEB_CONCURRENCY environment variable:

$ WEB_CONCURRENCY=3 puma -t 8:32

Note that threads are still used in clustered mode, and the -t thread flag setting is per worker, so -w 2 -t 16:16 will spawn 32 threads in total, with 16 in each worker process.

For an in-depth discussion of the tradeoffs of thread and process count settings, see our docs.

In clustered mode, Puma can "preload" your application. This loads all the application code prior to forking. Preloading reduces total memory usage of your application via an operating system feature called copy-on-write.

If the WEB_CONCURRENCY environment variable is set to a value > 1 (and --prune-bundler has not been specified), preloading will be enabled by default. Otherwise, you can use the --preload flag from the command line:

$ puma -w 3 --preload

Or, if you're using a configuration file, you can use the preload_app! method:

# config/puma.rb
workers 3
preload_app!

Preloading can’t be used with phased restart, since phased restart kills and restarts workers one-by-one, and preloading copies the code of master into the workers.

Clustered mode hooks

When using clustered mode, Puma's configuration DSL provides before_fork and on_worker_boot hooks to run code when the master process forks and child workers are booted respectively.

It is recommended to use these hooks with preload_app!, otherwise constants loaded by your application (such as Rails) will not be available inside the hooks.

# config/puma.rb
before_fork do
  # Add code to run inside the Puma master process before it forks a worker child.
end

on_worker_boot do
  # Add code to run inside the Puma worker process after forking.
end

In addition, there is an on_refork hook which is used only in fork_worker mode, when the worker 0 child process forks a grandchild worker:

on_refork do
  # Used only when fork_worker mode is enabled. Add code to run inside the Puma worker 0
  # child process before it forks a grandchild worker.
end

Importantly, note the following considerations when Ruby forks a child process:

  1. File descriptors such as network sockets are copied from the parent to the forked child process. Dual-use of the same sockets by parent and child will result in I/O conflicts such as SocketError, Errno::EPIPE, and EOFError.
  2. Background Ruby threads, including threads used by various third-party gems for connection monitoring, etc., are not copied to the child process. Often this does not cause immediate problems until a third-party connection goes down, at which point there will be no supervisor to reconnect it.

Therefore, we recommend the following:

  1. If possible, do not establish any socket connections (HTTP, database connections, etc.) inside Puma's master process when booting.
  2. If (1) is not possible, use before_fork and on_refork to disconnect the parent's socket connections when forking, so that they are not accidentally copied to the child process.
  3. Use on_worker_boot to restart any background threads on the forked child.

Master process lifecycle hooks

Puma's configuration DSL provides master process lifecycle hooks on_booted, on_restart, and on_stopped which may be used to specify code blocks to run on each event:

# config/puma.rb
on_booted do
  # Add code to run in the Puma master process after it boots,
  # and also after a phased restart completes.
end

on_restart do
  # Add code to run in the Puma master process when it receives
  # a restart command but before it restarts.
end

on_stopped do
  # Add code to run in the Puma master process when it receives
  # a stop command but before it shuts down.
end

Error handling

If Puma encounters an error outside of the context of your application, it will respond with a 400/500 and a simple textual error message (see Puma::Server#lowlevel_error or server.rb). You can specify custom behavior for this scenario. For example, you can report the error to your third-party error-tracking service (in this example, rollbar):

lowlevel_error_handler do |e, env, status|
  if status == 400
    message = "The server could not process the request due to an error, such as an incorrectly typed URL, malformed syntax, or a URL that contains illegal characters.\n"
  else
    message = "An error has occurred, and engineers have been informed. Please reload the page. If you continue to have problems, contact [email protected]\n"
    Rollbar.critical(e)
  end

  [status, {}, [message]]
end

Binding TCP / Sockets

Bind Puma to a socket with the -b (or --bind) flag:

$ puma -b tcp://127.0.0.1:9292

To use a UNIX Socket instead of TCP:

$ puma -b unix:///var/run/puma.sock

If you need to change the permissions of the UNIX socket, just add a umask parameter:

$ puma -b 'unix:///var/run/puma.sock?umask=0111'

Need a bit of security? Use SSL sockets:

$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'

Self-signed SSL certificates (via the localhost gem, for development use):

Puma supports the localhost gem for self-signed certificates. This is particularly useful if you want to use Puma with SSL locally, and self-signed certificates will work for your use-case. Currently, the integration can only be used in MRI.

Puma automatically configures SSL when the localhost gem is loaded in a development environment:

Add the gem to your Gemfile:

group(:development) do
  gem 'localhost'
end

And require it implicitly using bundler:

require "bundler"
Bundler.require(:default, ENV["RACK_ENV"].to_sym)

Alternatively, you can require the gem in your configuration file, either config/puma/development.rb, config/puma.rb, or set via the -C cli option:

require 'localhost'
# configuration methods (from Puma::DSL) as needed

Additionally, Puma must be listening to an SSL socket:

$ puma -b 'ssl://localhost:9292' -C config/use_local_host.rb

# The following options allow you to reach Puma over HTTP as well:
$ puma -b ssl://localhost:9292 -b tcp://localhost:9393 -C config/use_local_host.rb

Controlling SSL Cipher Suites

To use or avoid specific SSL ciphers for TLSv1.2 and below, use ssl_cipher_filter or ssl_cipher_list options.

Ruby:
$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&ssl_cipher_filter=!aNULL:AES+SHA'
JRuby:
$ puma -b 'ssl://127.0.0.1:9292?keystore=path_to_keystore&keystore-pass=keystore_password&ssl_cipher_list=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA'

To configure the available TLSv1.3 ciphersuites, use ssl_ciphersuites option (not available for JRuby).

Ruby:
$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&ssl_ciphersuites=TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256'

See https://www.openssl.org/docs/man1.1.1/man1/ciphers.html for cipher filter format and full list of cipher suites.

Disable TLS v1 with the no_tlsv1 option:

$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&no_tlsv1=true'

Controlling OpenSSL Verification Flags

To enable verification flags offered by OpenSSL, use verification_flags (not available for JRuby):

$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&verification_flags=PARTIAL_CHAIN'

You can also set multiple verification flags (by separating them with coma):

$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&verification_flags=PARTIAL_CHAIN,CRL_CHECK'

List of available flags: USE_CHECK_TIME, CRL_CHECK, CRL_CHECK_ALL, IGNORE_CRITICAL, X509_STRICT, ALLOW_PROXY_CERTS, POLICY_CHECK, EXPLICIT_POLICY, INHIBIT_ANY, INHIBIT_MAP, NOTIFY_POLICY, EXTENDED_CRL_SUPPORT, USE_DELTAS, CHECK_SS_SIGNATURE, TRUSTED_FIRST, SUITEB_128_LOS_ONLY, SUITEB_192_LOS, SUITEB_128_LOS, PARTIAL_CHAIN, NO_ALT_CHAINS, NO_CHECK_TIME (see https://www.openssl.org/docs/manmaster/man3/X509_VERIFY_PARAM_set_hostflags.html#VERIFICATION-FLAGS).

Controlling OpenSSL Password Decryption

To enable runtime decryption of an encrypted SSL key (not available for JRuby), use key_password_command:

$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert&key_password_command=/path/to/command.sh'

key_password_command must:

  1. Be executable by Puma.
  2. Print the decryption password to stdout.

For example:

#!/bin/sh

echo "this is my password"

key_password_command can be used with key or key_pem. If the key is not encrypted, the executable will not be called.

Control/Status Server

Puma has a built-in status and control app that can be used to query and control Puma.

$ puma --control-url tcp://127.0.0.1:9293 --control-token foo

Puma will start the control server on localhost port 9293. All requests to the control server will need to include control token (in this case, token=foo) as a query parameter. This allows for simple authentication. Check out Puma::App::Status or status.rb to see what the status app has available.

You can also interact with the control server via pumactl. This command will restart Puma:

$ pumactl --control-url 'tcp://127.0.0.1:9293' --control-token foo restart

To see a list of pumactl options, use pumactl --help.

Configuration File

You can also provide a configuration file with the -C (or --config) flag:

$ puma -C /path/to/config

If no configuration file is specified, Puma will look for a configuration file at config/puma.rb. If an environment is specified (via the --environment flag or through the APP_ENV, RACK_ENV, or RAILS_ENV environment variables) Puma looks for a configuration file at config/puma/<environment_name>.rb and then falls back to config/puma.rb.

If you want to prevent Puma from looking for a configuration file in those locations, include the --no-config flag:

$ puma --no-config

# or

$ puma -C "-"

The other side-effects of setting the environment are whether to show stack traces (in development or test), and setting RACK_ENV may potentially affect middleware looking for this value to change their behavior. The default puma RACK_ENV value is development. You can see all config default values in Puma::Configuration#puma_default_options or configuration.rb.

Check out Puma::DSL or dsl.rb to see all available options.

Restart

Puma includes the ability to restart itself. When available (MRI, Rubinius, JRuby), Puma performs a "hot restart". This is the same functionality available in Unicorn and NGINX which keep the server sockets open between restarts. This makes sure that no pending requests are dropped while the restart is taking place.

For more, see the Restart documentation.

Signals

Puma responds to several signals. A detailed guide to using UNIX signals with Puma can be found in the Signals documentation.

Platform Constraints

Some platforms do not support all Puma features.

  • JRuby, Windows: server sockets are not seamless on restart, they must be closed and reopened. These platforms have no way to pass descriptors into a new process that is exposed to Ruby. Also, cluster mode is not supported due to a lack of fork(2).
  • Windows: Cluster mode is not supported due to a lack of fork(2).
  • Kubernetes: The way Kubernetes handles pod shutdowns interacts poorly with server processes implementing graceful shutdown, like Puma. See the kubernetes section of the documentation for more details.

Known Bugs

For MRI versions 2.2.7, 2.2.8, 2.2.9, 2.2.10, 2.3.4 and 2.4.1, you may see stream closed in another thread (IOError). It may be caused by a Ruby bug. It can be fixed with the gem https://rubygems.org/gems/stopgap_13632:

if %w(2.2.7 2.2.8 2.2.9 2.2.10 2.3.4 2.4.1).include? RUBY_VERSION
  begin
    require 'stopgap_13632'
  rescue LoadError
  end
end

Deployment

  • Puma has support for Capistrano with an external gem.

  • Additionally, Puma has support for built-in daemonization via the puma-daemon ruby gem. The gem restores the daemonize option that was removed from Puma starting version 5, but only for MRI Ruby.

It is common to use process monitors with Puma. Modern process monitors like systemd or rc.d provide continuous monitoring and restarts for increased reliability in production environments:

Community guides:

Community Extensions

Plugins

  • puma-metrics — export Puma metrics to Prometheus
  • puma-plugin-statsd — send Puma metrics to statsd
  • puma-plugin-systemd — deeper integration with systemd for notify, status and watchdog. Puma 5.1.0 integrated notify and watchdog, which probably conflicts with this plugin. Puma 6.1.0 added status support which obsoletes the plugin entirely.
  • puma-plugin-telemetry - telemetry plugin for Puma offering various targets to publish
  • puma-acme - automatic SSL/HTTPS certificate provisioning and setup

Monitoring

  • puma-status — Monitor CPU/Mem/Load of running puma instances from the CLI

Contributing

Find details for contributing in the contribution guide.

License

Puma is copyright Evan Phoenix and contributors, licensed under the BSD 3-Clause license. See the included LICENSE file for details.

puma-dev's People

Contributors

amasses avatar attilagyorffy avatar barrywoolgar avatar cjlarose avatar defeated avatar dlackty avatar evanphx avatar fnando avatar hellvinz avatar javan avatar joeman29 avatar kieraneglin avatar koenpunt avatar krasnoukhov avatar lodestone avatar matthewrudy avatar mlarraz avatar nateberkopec avatar nickgervasi avatar nonrational avatar nv avatar paulca avatar pda avatar richardvenneman avatar rmm5t avatar sesam avatar vlado avatar vojtad avatar xanderificnl avatar yoerayo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puma-dev's Issues

fork: Resource temporarily unavailable occurring since installing

Since installing puma-dev, apart from my development environment being better than it's ever been, I have noticed occasionally that I get:

fork: Resource temporarily unavailable when trying any operation in Terminal. I first noticed it when tabs started crashing in Chrome.

It could be something unrelated, but a quick google for that error leads to articles about launchd so it seems a bit co-incidental.

I have no idea what's causing it ... a memory leak perhaps? I'm not all that sure where to start looking. For the most part, unloading and reloading puma-dev using launchctl solves it, or just quitting all apps and restarting them.

Could be nothing, but I thought this might tip you off to something that I'm not able to suggest!

touch tmp/restart.txt always leads to connection refused

I haven't been able to use touch/tmp/restart.txt with the latest release...

Here's what happens in the logs:

! App 'billing.tito' booted
! Killing 'billing.tito' (24599)
2016/08/10 12:13:08 http: proxy error: dial unix /Users/paulcampbell/.puma-dev/billing.tito/tmp/puma-dev-24598.sock: connect: connection refused

In the browser, the viewport just goes blank white.

unload/reload via launchctl works and is fast enough for me for now.

Timeout on attempt to load site.dev

Is there a way to debug timeout issues?

I symlinked a domain that works with Pow and it never managed to load. After trying -cleanup, -setup, and -pow I eventually got to:

It works!

But not much else. I'm just curious how I can observe puma-dev listening somewhere to see if I'm actually hitting it. That's a thing I commonly do with pow and Powder.

.test domain by default

Since Google is now in possession of the .dev domain, I believe .test domain is more acceptable to anyone as it's reserved for the use cases exactly like this?

https://iyware.com/dont-use-dev-for-development/

I know it is configurable, but I think the default / convention is key for those who work in multiple projects. What do you think?

Web sockets on 0.8 release

I've followed the setup as best I can here:

development.rb:

config.app_domain = 'mygame.dev'
config.web_socket_server_url = "ws://#{config.app_domain}/cable" 
config.action_cable.allowed_request_origins = /(\.dev$)|^localhost$/

I load the page and see after the page loads...

Started GET "/cable" for 127.0.0.1 at 2016-08-08 14:23:50 -0500
  ActiveRecord::SchemaMigration Load (4.6ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Started GET "/cable/"[non-WebSocket] for 127.0.0.1 at 2016-08-08 14:23:50 -0500
Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: , HTTP_UPGRADE: )
Finished "/cable/"[non-WebSocket] for 127.0.0.1 at 2016-08-08 14:23:50 -0500

Homebrew Formula

Being able to install puma-dev through Homebrew would be great. I'd be happy to try creating a Homebrew formula that would make this possible, if we could get a release with the changes from #3 in the .tar.gz file.

Configurable subdomains

Having *.host for subdomains is fantastic. Pow also allows configurable subdomains so that you can specify which subdomain goes to which host.

I'm faking it with - for now, but with SSL, the urge to just be able to mimic production subdomains verbatim is high!

Thank you so much again @evanphx 😍😍😍😍😍😍😍😍

Unable to install

Been going in circles trying to get this installed... Had pow before, removed it before starting.

Fail

jaiken@firefly ➜ ~  sudo puma-dev -cleanup                                                                                                                                                                                                                                                                 
* Expunged old puma dev system rules
* Fixed permissions of user LaunchAgent

jaiken@firefly ➜ ~  sudo puma-dev -uninstall                                                                                                                                                                                                                                                                   
* Removed puma-dev from automatically running
* Removed domain 'dev'

jaiken@firefly ➜ ~  sudo puma-dev -setup                                                                                                                                                                                                                                                                       
* Configuring /etc/resolver to be owned by jaiken

jaiken@firefly ➜ ~  puma-dev install                                                                                                                                                                                                                                                                           
2016/08/01 17:28:36 Unable to setup TLS cert: exit status 1

jaiken@firefly ಠ_ಠ ➜ ~

Versions:

  • OS: 10.11.5
  • Homebrew : Homebrew 0.9.9 (git revision a5a93; last commit 2016-07-31)
  • Pumadev: 0.7

resolver

jaiken@firefly ➜ ~  cat /etc/resolver/dev                                                                                                                                                                                                                                                                  
# Generated by puma-dev
nameserver 127.0.0.1
port 9253

puma-dev.log

Lots and lots and lots of Unable to expand dir: exit status 1's

Doesn't Start With Fish Shell

When tailing the ~/Library/Log/puma-dev.log I see:

* Directory for apps: /Users/kevin/.puma-dev
* Domains: dev
* DNS Server port: 9253
* HTTP Server port: inherited from launchd
* HTTPS Server port: inherited from launchd
! Puma dev listening on http and https
! Booted app 'ksylvest' on socket /Users/kevin/.puma-dev/ksylvest/tmp/puma-dev-811.sock
Missing end to balance this if statement
fish: if test -e Gemfile; then
      ^
^C⏎      

I'm running fish as the login shell (i.e. chsh -s /usr/local/bin/fish). Changing the login shell to bash fixes the problem. The offending lines appear to be the conditionals (if; fi vs. https://fishshell.com/docs/current/tutorial.html#tut_conditionals):

https://github.com/puma/puma-dev/blob/master/src/puma/dev/app.go#L183-L202

I've got no experience with go - but can a shebang be added to the exec.Command?

Alternatively - can the shell just be explicitly set to "sh" here https://github.com/puma/puma-dev/blob/master/src/puma/dev/app.go#L219?

ENV Support

The other thing that pow did really well was .powenv which was just a file with environment variables that get passed to the running app.

$ cat .powenv
export SOME_VAR=some-value

http: panic serving 127.0.0.1:49439: runtime error: slice bounds out of range

When running puma-dev in the foreground (as i couldn't get it to work in the background) I am finding some strange output that references @evanphx's own path :) Here's my terminal output:

$ puma-dev
* Directory for apps: /Users/attila/.puma-dev
* Domains: dev
* DNS Server port: 9253
* HTTP Server port: 9280
* HTTPS Server port: 9283
! Puma dev listening on http and https
2016/08/03 17:52:07 http: panic serving 127.0.0.1:49439: runtime error: slice bounds out of rangegoroutine 4 [running]:
net/http.(*conn).serve.func1(0xc82015a000)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1389 +0xc1
panic(0x4438e00, 0xc82000a090)
    /usr/local/Cellar/go/1.6.3/libexec/src/runtime/panic.go:443 +0x4e9
puma/dev.(*HTTPServer).director(0xc820121e90, 0xc8201600e0, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:69 +0x193
puma/dev.(*HTTPServer).(puma/dev.director)-fm(0xc8201600e0, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:79 +0x38
puma/httputil.(*ReverseProxy).ServeHTTP(0xc820124eb0, 0x4e401f8, 0xc8201500d0, 0xc820160000)
    /Users/evan/git/puma-dev/src/puma/httputil/reverseproxy.go:182 +0x4cb
net/http.serverHandler.ServeHTTP(0xc820116f00, 0x4e401f8, 0xc8201500d0, 0xc820160000)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc82015a000)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2137 +0x44e
2016/08/03 17:52:07 http: panic serving 127.0.0.1:49441: runtime error: slice bounds out of range
goroutine 6 [running]:
net/http.(*conn).serve.func1(0xc82015a280)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1389 +0xc1
panic(0x4438e00, 0xc82000a090)
    /usr/local/Cellar/go/1.6.3/libexec/src/runtime/panic.go:443 +0x4e9
puma/dev.(*HTTPServer).director(0xc820121e90, 0xc82012a0e0, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:69 +0x193
puma/dev.(*HTTPServer).(puma/dev.director)-fm(0xc82012a0e0, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:79 +0x38
puma/httputil.(*ReverseProxy).ServeHTTP(0xc820124eb0, 0x4e401f8, 0xc8200e2c30, 0xc8201601c0)
    /Users/evan/git/puma-dev/src/puma/httputil/reverseproxy.go:182 +0x4cb
net/http.serverHandler.ServeHTTP(0xc820116f00, 0x4e401f8, 0xc8200e2c30, 0xc8201601c0)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc82015a280)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2137 +0x44e
2016/08/03 17:52:07 http: panic serving 127.0.0.1:49443: runtime error: slice bounds out of range
goroutine 7 [running]:
net/http.(*conn).serve.func1(0xc82015a300)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1389 +0xc1
panic(0x4438e00, 0xc82000a090)
    /usr/local/Cellar/go/1.6.3/libexec/src/runtime/panic.go:443 +0x4e9
puma/dev.(*HTTPServer).director(0xc820121e90, 0xc820160380, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:69 +0x193
puma/dev.(*HTTPServer).(puma/dev.director)-fm(0xc820160380, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:79 +0x38
puma/httputil.(*ReverseProxy).ServeHTTP(0xc820124eb0, 0x4e401f8, 0xc820150270, 0xc8201602a0)
    /Users/evan/git/puma-dev/src/puma/httputil/reverseproxy.go:182 +0x4cb
net/http.serverHandler.ServeHTTP(0xc820116f00, 0x4e401f8, 0xc820150270, 0xc8201602a0)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc82015a300)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2137 +0x44e
2016/08/03 17:52:11 http: panic serving 127.0.0.1:49446: runtime error: slice bounds out of range
goroutine 26 [running]:
net/http.(*conn).serve.func1(0xc820117180)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1389 +0xc1
panic(0x4438e00, 0xc82000a090)
    /usr/local/Cellar/go/1.6.3/libexec/src/runtime/panic.go:443 +0x4e9
puma/dev.(*HTTPServer).director(0xc820121e90, 0xc820160460, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:69 +0x193
puma/dev.(*HTTPServer).(puma/dev.director)-fm(0xc820160460, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:79 +0x38
puma/httputil.(*ReverseProxy).ServeHTTP(0xc820124eb0, 0x4e401f8, 0xc820150410, 0xc82012a1c0)
    /Users/evan/git/puma-dev/src/puma/httputil/reverseproxy.go:182 +0x4cb
net/http.serverHandler.ServeHTTP(0xc820116f00, 0x4e401f8, 0xc820150410, 0xc82012a1c0)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc820117180)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2137 +0x44e
2016/08/03 17:52:11 http: panic serving 127.0.0.1:49448: runtime error: slice bounds out of range
goroutine 36 [running]:
net/http.(*conn).serve.func1(0xc8201b4000)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1389 +0xc1
panic(0x4438e00, 0xc82000a090)
    /usr/local/Cellar/go/1.6.3/libexec/src/runtime/panic.go:443 +0x4e9
puma/dev.(*HTTPServer).director(0xc820121e90, 0xc8201ba0e0, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:69 +0x193
puma/dev.(*HTTPServer).(puma/dev.director)-fm(0xc8201ba0e0, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:79 +0x38
puma/httputil.(*ReverseProxy).ServeHTTP(0xc820124eb0, 0x4e401f8, 0xc82013c0d0, 0xc8201ba000)
    /Users/evan/git/puma-dev/src/puma/httputil/reverseproxy.go:182 +0x4cb
net/http.serverHandler.ServeHTTP(0xc820116f00, 0x4e401f8, 0xc82013c0d0, 0xc8201ba000)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc8201b4000)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2137 +0x44e
2016/08/03 17:52:11 http: panic serving 127.0.0.1:49450: runtime error: slice bounds out of range
goroutine 38 [running]:
net/http.(*conn).serve.func1(0xc8201b4200)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1389 +0xc1
panic(0x4438e00, 0xc82000a090)
    /usr/local/Cellar/go/1.6.3/libexec/src/runtime/panic.go:443 +0x4e9
puma/dev.(*HTTPServer).director(0xc820121e90, 0xc8201ba2a0, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:69 +0x193
puma/dev.(*HTTPServer).(puma/dev.director)-fm(0xc8201ba2a0, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:79 +0x38
puma/httputil.(*ReverseProxy).ServeHTTP(0xc820124eb0, 0x4e401f8, 0xc82013c270, 0xc8201ba1c0)
    /Users/evan/git/puma-dev/src/puma/httputil/reverseproxy.go:182 +0x4cb
net/http.serverHandler.ServeHTTP(0xc820116f00, 0x4e401f8, 0xc82013c270, 0xc8201ba1c0)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc8201b4200)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2137 +0x44e

Incompatible with ngrok for connection tunneling

ngrok is a HTTP tunneling tool for accessing hosts behind NAT by tunneling the network connection through a locally run script. This allows me to test webhook locally.

I have puma-dev functioning just fine so that I can access the app via my browser by navigating to

$ ngrok http railsapp.dev:80 returns a 500 "unknown app" when using puma-dev.

$ ngrok http localhost:3000 works fine with the same app when $ rails s is used.

Running latest version puma-dev's as a service on OSX 10.10. Installed via sudo puma-dev -setup

I'm not sure if this is a problem with puma-dev or ngrok. I didn't have any problems with pow with this same configuration, so I'm starting here. How can I help diagnose the problem?

Unsupported protocol scheme for proxying port on localhost

I'm trying to proxy http://localhost:4000 to site.photography.dev using the file ~/.puma-dev/site.photography and I keep getting this in the logs:

http: proxy error: unsupported protocol scheme:

I've tried several different contents of ~/.puma-dev/site.photography:

  • localhost:4000
  • http://localhost:4000
  • 127.0.0.1:4000
  • 4000

And I've received the same error for each different line. I don't know if it's that I'm using the incorrect content or if this is a bug, but any assistance would be helpful.

Getting "Bad file descriptor - not a socket file descriptor" with 0.4.

I'll keep trying to work through this, but here's the latest backtrace from puma-dev.log

(seemed to figure out my launchd issues anyway!)

passbook-tito[13567]: Puma starting in single mode...
passbook-tito[13567]: * Version 3.6.0 (ruby 2.3.0-p0), codename: Sleepy Sunday Serenity
passbook-tito[13567]: * Min threads: 0, max threads: 5
passbook-tito[13567]: * Environment: development
passbook-tito[13567]: * Inherited tcp://127.0.0.1:54367
Errno::EBADF: Bad file descriptor - not a socket file descriptor
  /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:284:in `for_fd'
  /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:284:in `inherit_tcp_listener'
  /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:91:in `block in parse'
  /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:85:in `each'
  /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/binder.rb:85:in `parse'
  /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/runner.rb:133:in `load_and_bind'
  /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/single.rb:85:in `run'
  /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/launcher.rb:172:in `run'
  /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/cli.rb:74:in `run'
  /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.6.0/bin/puma:10:in `<top (required)>'
  /usr/local/var/rbenv/versions/2.3.0/bin/puma:23:in `load'
  /usr/local/var/rbenv/versions/2.3.0/bin/puma:23:in `<top (required)>'
passbook-tito[13567]: bundler: failed to load command: puma (/usr/local/var/rbenv/versions/2.3.0/bin/puma)
* App 'passbook-tito' shutdown and cleaned up

bundle: not found

Similar to #25 perhaps, but after I installed (for the first time) puma-dev and try to get the app launched, I see bash: line 18: exec: bundle: not found in the ~/Library/Logs/puma-dev.log file.

I use zsh, with https://github.com/postmodern/chruby and have

source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh

in my ~/.zshrc to load up the correct PATH for my ruby version. Any ideas how to resolve?

runtime error: invalid memory address or nil pointer dereference

I see this error in the logs when i try to access a site:

2016/08/05 21:51:01 http: panic serving 127.0.0.1:50479: runtime error: invalid memory address or nil pointer dereference
goroutine 36 [running]:
net/http.(*conn).serve.func1(0xc820184400)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1389 +0xc1
panic(0x4438e00, 0xc8200100b0)
    /usr/local/Cellar/go/1.6.3/libexec/src/runtime/panic.go:443 +0x4e9
puma/dev.(*AppPool).App(0xc820015410, 0xc82017a1c0, 0x7, 0x0, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/app.go:318 +0x349
puma/dev.(*HTTPServer).hostForApp(0xc8201423f0, 0xc82017a1c0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:46 +0x82
puma/dev.(*HTTPServer).director(0xc8201423f0, 0xc820182380, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:72 +0xb3
puma/dev.(*HTTPServer).(puma/dev.director)-fm(0xc820182380, 0x0, 0x0)
    /Users/evan/git/puma-dev/src/puma/dev/http.go:79 +0x38
puma/httputil.(*ReverseProxy).ServeHTTP(0xc820146410, 0x62c4080, 0xc8201884e0, 0xc8201822a0)
    /Users/evan/git/puma-dev/src/puma/httputil/reverseproxy.go:182 +0x4cb
net/http.serverHandler.ServeHTTP(0xc820135380, 0x62c4080, 0xc8201884e0, 0xc8201822a0)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc820184400)
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
    /usr/local/Cellar/go/1.6.3/libexec/src/net/http/server.go:2137 +0x44e

Puma-dev hangs after loading on macOS Sierra unless compiled with go 1.6.3

I get the the point where I see Use Ctrl-C to stop and that's where things stop.

The page doesn't open in a Browser and it doesn't stop when I Ctrl-C. Instead I have to kill it.

Here's my output:

* Directory for apps: /Users/madsen/.puma-dev
* Domains: pdev
* DNS Server port: 9253
* HTTP Server port: 9280
! Puma dev listening
! Booted app 'tex' on socket /Users/madsen/.puma-dev/tex/tmp/puma-dev-23072.sock
tex[23075]: Puma starting in single mode...
tex[23075]: * Version 3.6.0 (ruby 2.2.5-p319), codename: Sleepy Sunday Serenity
tex[23075]: * Min threads: 0, max threads: 5
tex[23075]: * Environment: development
/Users/madsen/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/dragonfly-0.9.14/lib/dragonfly/data_storage/s3data_store.rb:27: warning: duplicated key at line 28 ignored: "sa-east-1"
tex[23075]: * Listening on unix:/Users/madsen/.puma-dev/tex/tmp/puma-dev-23072.sock
tex[23075]: Use Ctrl-C to stop

Support tmp/always_restart.txt

Pow and Phusion passenger both support tmp/always_restart.txt to always reload the application.
Would be nice to have that in puma-dev also.

`Error listening: accept tcp 0.0.0.0:0: accept: invalid argument` El Capitan - 10.11.6

I have run through the setup with homebrew but the my sites never seem to load.

Running tail -f ~/Library/Logs/puma-dev.log shows this output

2016/08/03 14:50:32 Error listening: accept tcp 0.0.0.0:0: accept: invalid argument
* Directory for apps: /Users/kip/.puma-dev
* Domains: dev
* DNS Server port: 9253
* HTTP Server port: inherited from launchd
* HTTPS Server port: inherited from launchd
! Puma dev listening on http and https
2016/08/03 14:50:42 Error listening: accept tcp 0.0.0.0:0: accept: invalid argument

Any ideas what i've done wrong?

Thanks

Unable to configure OS X resolver: open /etc/resolver/dev: permission denied

Fresh install of puma-dev and I was getting the following error in the logs. Same log message every 10 seconds as launchd would respawn it:

tail -1 ~/Library/Logs/puma-dev.log
2016/08/04 14:18:21 Unable to configure OS X resolver: open /etc/resolver/dev: permission denied

I installed via homebrew, and ran the install. Something like this:

brew install puma/puma/puma-dev
puma-dev -install

Got the root password prompt, and everything.

Still the local apps were timing out.

To work around this issue, I bestowed the most evilest of permissions on the file. The permissions of the beast.

sudo chmod 666 /etc/resolver/dev

Now everything is working and happy. But that hack seems wrong. Unholy even. 👹

Disconnected from logs

I had ~/Library/Logs/puma-dev.log open in TextMate for debugging issues, and everything was going fine, until I decided "oh let me clear the log so I can see better what happens next". So I idd ctrl+a, backspace, save. Then no more entries were written to the log. I tried also running pkill -USR1 puma-dev and restarting the app server but still nothing is getting written. What can I do to reconnect puma-dev to the log?

Actioncable /cable not found

I seem to be having some issues with getting actioncable working in-app, it resulting in 404 errors in the browser and these errors in the logs:

Started GET "/cable" for 127.0.0.1 at 2016-07-31 21:04:47 -0400
Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: , HTTP_UPGRADE: )
Finished "/cable/"[non-WebSocket] for 127.0.0.1 at 2016-07-31 21:04:41 -0400

Random Connection Pool Issue

Got an ActiveRecord connection pool issue after running for about 30 minutes, oddly specificly loading application.css:

2016-07-27 21:57:28 +0100: Rack app error handling request { GET /assets/application.self-5502ac0a518b518e0fb0a7d46440c3de790c3be6e3e65c87518166a3e8a71cdf.css }
#<ActiveRecord::ConnectionTimeoutError: could not obtain a connection from the pool within 5.000 seconds (waited 5.003 seconds); all pooled connections were in use>
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:202:in `block in wait_poll'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:193:in `loop'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:193:in `wait_poll'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:154:in `internal_poll'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:278:in `internal_poll'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:148:in `block in poll'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:158:in `synchronize'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:148:in `poll'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:709:in `acquire_connection'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:501:in `checkout'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:364:in `connection'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:875:in `retrieve_connection'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_handling.rb:128:in `retrieve_connection'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_handling.rb:91:in `connection'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/query_cache.rb:39:in `complete'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/execution_wrapper.rb:43:in `block in register_hook'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:396:in `instance_exec'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:396:in `block in make_lambda'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:169:in `block (2 levels) in halting'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:547:in `block (2 levels) in default_terminator'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:546:in `catch'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:546:in `block in default_terminator'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:170:in `block in halting'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:454:in `block in call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:454:in `each'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:454:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:101:in `__run_callbacks__'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:750:in `_run_complete_callbacks'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:90:in `run_callbacks'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/execution_wrapper.rb:107:in `complete!'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0/lib/action_dispatch/middleware/executor.rb:13:in `block in call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/body_proxy.rb:23:in `close'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/honeybadger-2.6.0/lib/honeybadger/rack/user_feedback.rb:34:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/honeybadger-2.6.0/lib/honeybadger/rack/user_informer.rb:18:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/engine.rb:522:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.5.2/lib/puma/configuration.rb:225:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.5.2/lib/puma/server.rb:569:in `handle_request'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.5.2/lib/puma/server.rb:406:in `process_client'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.5.2/lib/puma/server.rb:271:in `block in run'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.5.2/lib/puma/thread_pool.rb:116:in `block in spawn_thread'
2016-07-27 21:57:38 +0100: Rack app error handling request { GET /assets/action_cable.self-1641ec3e8ea24ed63601e86efcca7f9266e09f390e82199d56aa7e4bd50e1aa9.js }
#<ActiveRecord::ConnectionTimeoutError: could not obtain a connection from the pool within 5.000 seconds (waited 5.001 seconds); all pooled connections were in use>
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:202:in `block in wait_poll'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:193:in `loop'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:193:in `wait_poll'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:154:in `internal_poll'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:278:in `internal_poll'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:148:in `block in poll'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:158:in `synchronize'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:148:in `poll'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:709:in `acquire_connection'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:501:in `checkout'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:364:in `connection'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:875:in `retrieve_connection'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_handling.rb:128:in `retrieve_connection'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/connection_handling.rb:91:in `connection'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0/lib/active_record/query_cache.rb:47:in `block in install_executor_hooks'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:396:in `instance_exec'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:396:in `block in make_lambda'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:169:in `block (2 levels) in halting'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:547:in `block (2 levels) in default_terminator'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:546:in `catch'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:546:in `block in default_terminator'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:170:in `block in halting'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:454:in `block in call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:454:in `each'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:454:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:101:in `__run_callbacks__'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:750:in `_run_complete_callbacks'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:90:in `run_callbacks'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/execution_wrapper.rb:107:in `complete!'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/execution_wrapper.rb:64:in `ensure in block in run!'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/execution_wrapper.rb:64:in `block in run!'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/execution_wrapper.rb:58:in `tap'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/execution_wrapper.rb:58:in `run!'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0/lib/action_dispatch/middleware/executor.rb:10:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0/lib/action_dispatch/middleware/static.rb:136:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/sendfile.rb:111:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/honeybadger-2.6.0/lib/honeybadger/rack/error_notifier.rb:33:in `block in call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/honeybadger-2.6.0/lib/honeybadger/config.rb:198:in `with_request'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/honeybadger-2.6.0/lib/honeybadger/rack/error_notifier.rb:30:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/honeybadger-2.6.0/lib/honeybadger/rack/user_feedback.rb:28:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/honeybadger-2.6.0/lib/honeybadger/rack/user_informer.rb:18:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/engine.rb:522:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.5.2/lib/puma/configuration.rb:225:in `call'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.5.2/lib/puma/server.rb:569:in `handle_request'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.5.2/lib/puma/server.rb:406:in `process_client'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.5.2/lib/puma/server.rb:271:in `block in run'
/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.5.2/lib/puma/thread_pool.rb:116:in `block in spawn_thread'

Errno::EBADF: Bad file descriptor - not a socket file descriptor in Puma.

I am not sure if this issue related to macOS 10.12.

I know there's an issue for go versions before 1.6.3 that causes all sorts of strange problems -- But I did try to locally on 1.6.3 compile and I see the same messages.

Here's what I see

test-app[6391]: Puma starting in single mode...
test-app[6391]: * Version 3.6.0 (ruby 2.2.5-p319), codename: Sleepy Sunday Serenity
test-app[6391]: * Min threads: 0, max threads: 5
test-app[6391]: * Environment: development
/Users/madsen/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/dragonfly-0.9.14/lib/dragonfly/data_storage/s3data_store.rb:27: warning: duplicated key at line 28 ignored: "sa-east-1"
test-app[6391]: * Inherited tcp://127.0.0.1:50144
test-app[6391]: bundler: failed to load command: puma (/Users/madsen/.rbenv/versions/2.2.5/bin/puma)
Errno::EBADF: Bad file descriptor - not a socket file descriptor
  /Users/madsen/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/binder.rb:284:in `for_fd'
  /Users/madsen/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/binder.rb:284:in `inherit_tcp_listener'
  /Users/madsen/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/binder.rb:91:in `block in parse'
  /Users/madsen/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/binder.rb:85:in `each'
  /Users/madsen/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/binder.rb:85:in `parse'
  /Users/madsen/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/runner.rb:133:in `load_and_bind'
  /Users/madsen/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/single.rb:85:in `run'
  /Users/madsen/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/launcher.rb:172:in `run'
  /Users/madsen/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/puma-3.6.0/lib/puma/cli.rb:74:in `run'
  /Users/madsen/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/puma-3.6.0/bin/puma:10:in `<top (required)>'
  /Users/madsen/.rbenv/versions/2.2.5/bin/puma:23:in `load'
  /Users/madsen/.rbenv/versions/2.2.5/bin/puma:23:in `<top (required)>'
* App 'test-app' shutdown and cleaned up

When the rails application failed to load on boot, I have to reload the agent.

When I have file using a non-existing class (in my case ActiveModel::Serializer, due to not having it in my Gemfile yet), and I try to load the application, I see in the logs the app crashed:

 ! Unable to load application: NameError: uninitialized constant ActiveModel::Serializer
 bundler: failed to load command: puma (/Users/koenpunt/.rbenv/versions/2.2.2/bin/puma)
... full trace here ...

But puma-dev can't recover from this by itself, and to get it running again I have unload and load the agent.

launchctl unload ~/Library/LaunchAgents/io.puma.dev.plist
launchctl load ~/Library/LaunchAgents/io.puma.dev.plist

Would be nice if the server could catch and recover from this by presenting the browser with a basic error

Consider defaulting to ".dev"

...I would expect that anyone installing this would want to replace pow rather than run alongside, and if running alongside that would be the non-default case.

It's fine if you just want to close this, but I think the generic .dev is cleaner than pdev which reveals a bit about the mechanics. Feels like pdev should be the compatibility mode and dev should be the default.

<3 <3 <3

😄

`remote error: unknown certificate` on Sierra

Think I have everything set up correctly, but when I hit my .dev domain a few times in Safari I'm getting this in puma-dev.log:

2016/07/30 17:32:58 http: TLS handshake error from 127.0.0.1:63670: remote error: unknown certificate
2016/07/30 17:33:00 http: TLS handshake error from 127.0.0.1:63672: remote error: unknown certificate
2016/07/30 17:33:02 http: TLS handshake error from 127.0.0.1:63673: remote error: unknown certificate

I'm seeing the puma cert added correctly in Keychain Access, and in ~/Library/Application Support/io.puma.dev.

Error is syslog: "(Socket) No PATH environment variable set."

I see the following messages from com.apple.xpc.launchd[1] in my system.log.

When running standalone it works just fine.

(io.puma.dev) This service is defined to be constantly running and is inherently inefficient.
(Socket) No PATH environment variable set. The application firewall will not work with this service.
(io.puma.dev[10424]) Service could not initialize: 15G7a: xpcproxy + 12684 [1462][F7717708-ACF7-307D-B04E-998DFC36598F]: 0xd
(io.puma.dev) Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

Edit that was after I tried changing zsh to sh/bash. Reverting that gives me different messages, but still not working:

(io.puma.dev[10700]) Service could not initialize: 15G7a: xpcproxy + 12684 [1462][F7717708-ACF7-307D-B04E-998DFC36598F]: 0xd
(io.puma.dev) Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

HTTPS support on OSX El Capitan FireFox

Here's what I'm seeing in my puma-dev log:

* Directory for apps: /Users/Glenn/.puma-dev
* Domains: dev
* DNS Server port: 9253
* HTTP Server port: inherited from launchd
* HTTPS Server port: inherited from launchd
! Puma dev listening on http and https
! Booting app 'mygame' on socket /Users/Glenn/.puma-dev/mygame/tmp/puma-dev-333.sock
mygame[1769]: bash: no job control in this shell
mygame[1769]: stty: stdin isn't a terminal
mygame[1769]: stty: stdin isn't a terminal
mygame[1769]: RVM loading: /Users/Glenn/.rvm/environments/ruby-2.3.0
mygame[1769]: Puma starting in single mode...
mygame[1769]: * Version 3.0.2 (ruby 2.3.0-p0), codename: Plethora of Penguin Pinatas
mygame[1769]: * Min threads: 0, max threads: 5
mygame[1769]: * Environment: development
mygame[1769]: * Listening on unix:/Users/Glenn/.puma-dev/mygame/tmp/puma-dev-333.sock
mygame[1769]: Use Ctrl-C to stop
! App 'mygame' booted
2016/08/08 13:58:43 http2: server: error reading preface from client 127.0.0.1:49506: remote error: unknown certificate authority
2016/08/08 13:59:59 http: TLS handshake error from 127.0.0.1:49623: EOF

This is after loading up the url in FireFox. I see "Your connection is not secure. The owner of mygame.dev has configured their website improperly".

Also after reading #26 I figured I'd try some suggestions there. Like running puma-dev directly and opening "https://mygame.dev:9283" shows this in the console:

 → puma-dev
* Directory for apps: /Users/Glenn/.puma-dev
* Domains: dev
* DNS Server port: 9253
* HTTP Server port: 9280
* HTTPS Server port: 9283
! Puma dev listening on http and https
2016/08/08 14:06:35 http2: server: error reading preface from client 127.0.0.1:49731: remote error: unknown certificate authority

Now Safari shows that the certificate is valid. However if I connect to my Rails + Turbolinks app via a WKWebView in iOS9, I see:

"The certificate for this server is invalid. You might be connecting to a server that is pretending to be “mygame.dev” which could put your confidential information at risk." UserInfo={error=Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “mygame.dev” which could put your confidential information at risk." UserInfo={NSUnderlyingError=0x7fbc40f08b20 {Error Domain=kCFErrorDomainCFNetwork Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “mygame.dev” which could put your confidential information at risk." UserInfo={_kCFStreamErrorDomainKey=3, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFNetworkCFStreamSSLErrorOriginalValue=-9813, _kCFStreamPropertySSLClientCertificateState=0, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “mygame.dev” which could put your confidential information at risk., NSErrorFailingURLKey=https://mygame.dev/, NSErrorFailingURLStringKey=https://mygame.dev/, _kCFStreamErrorCodeKey=-9813}}, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSErrorPeerCertificateChainKey=<CFArray 0x7fbc40f08ab0 [0x10bfe8a40]>{type = mutable-small, count = 1, values = (
    0 : <cert(0x7fbc40f08fc0) s: mygame.dev i: Puma-dev CA>
)}, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “mygame.dev” which could put your confidential information at risk., _WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x7fbc42015ee0>, NSErrorFailingURLKey=https://mygame.dev/, NSErrorClientCertificateStateKey=0, NSErrorFailingURLStringKey=https://mygame.dev/}, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “mygame.dev” which could put your confidential information at risk.}

Couldn't get 0.3 to work

0.3 doesn't work at all for me. El Cap 10.11.6.

I tried installing first, and got nothing. After a restart, manually running puma-dev gives me:

$ puma-dev
* Directory for apps: /Users/paulcampbell/.puma-dev
* Domains: pdev
* DNS Server port: 9253
* HTTP Server port: 9280
! Puma dev listening

But a visit to my linked site gets me a Connection refused:

$ curl http://organizer-tito.pdev
curl: (7) Failed to connect to organizer-tito.pdev port 80: Connection refused

Not sure what next debugging step should be.

puma-dev idle CPU at 50-60%

Wanted to split this off from #26 as it seems to be a legit lingering occasional issue.

This morning is a pretty good example of what's happening:

  • Restarted my machine an hour and two minutes ago
  • puma-dev started up and ran my app just fine
  • Around 5-10 minutes ago, puma-dev started hitting 50-60% CPU usage and staying there.
  • I took a sample of the process, but not sure how helpful it'll be (bit out of my depth in troubleshooting this).
  • My actual app is responsive and and accessible during all of this; my puma process is basically sitting at 0% CPU.

Killing the main puma-dev process and letting it restart brings everything back to normal (for now, at least).

Unload launchctl before uninstalling

Uninstalling puma-dev using puma-dev -uninstall removes the file in ~/Library/LaunchAgents/io.puma.dev.plist yet it doesn't seem to unload it first. The service is kept loaded in launchctl and I'm unable to unload it since the plist file is already removed from the system

I'd try to fix this myself (if puma-dev was written in Ruby) but as I can see the service uses Go and I have to admit I've never written a single line of Go myself yet.

Add config file support

Pow supported loading a config file which was super handy for people using a Ruby version manager like chruby. It let you do something like the following to make sure the server was using the right version of Ruby.

source /usr/local/opt/chruby/share/chruby/chruby.sh
chruby $(cat ~/.ruby-version)

Pretty simple stuff but very, very helpful.

puma-dev -install throws a launchd error

I installed puma-dev via homebrew on 10.11.6. Running the commands it outputs, when I run puma-dev -install I get the follow:

7/29/16 12:02:54.766 PM com.apple.xpc.launchd[1]: (io.puma.dev[3529]) Service could not initialize: 15G31: xpcproxy + 12684 [1462][F7717708-ACF7-307D-B04E-998DFC36598F]: 0xd 7/29/16 12:02:54.766 PM com.apple.xpc.launchd[1]: (io.puma.dev) Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

This repeats every 10 seconds until I uninstall.

[BUG] puma-dev does not compiles on Linux

It seems like README was not updated with the latest requirements to build puma-dev successfully.

The following error happens:

[hron@moonshine puma-dev (master)] $ go version
go version go1.6.3 linux/amd64
[hron@moonshine puma-dev (master)] $ make
gb build cmd/puma-dev
FATAL: command "build" failed: failed to resolve import path "cmd/puma-dev": import "flag": not found: stat /home/hron/build/puma-dev/src/flag: no such file or directory
make: *** [Makefile:2: all] Error 1
[hron@moonshine puma-dev (master)] $

Please:

  • Update README with correct requirements
  • And possibly provide Linux builds too.

Error listening: accept tcp 0.0.0.0:0: accept: invalid argument

Hey there,

Thanks for creating this project. I'm a core contributor on the Phoenix Framework and working with Channels in dev has been a pain with pow, so I'm looking forward to using this!

Unfortunately, I'm having trouble getting this to work. I've uninstalled pow and copied over my ~/.pow directory to ~/.puma-dev. All of my files are using the port proxy style configuration. I installed puma-dev via brew so I'm running 0.7.

After installing, I ran the following:

sudo puma-dev -setup
puma-dev -install

When tailing the log file I just see this every 10 secs:

* Directory for apps: /Users/scrogson/.puma-dev
* Domains: dev
* DNS Server port: 9253
* HTTP Server port: inherited from launchd
* HTTPS Server port: inherited from launchd
! Puma dev listening on http and https
2016/08/04 15:06:09 Error listening: accept tcp 0.0.0.0:0: accept: invalid argument

Not sure what to check next.

puma-dev restarts with .dev instead of .test I installed with

I installed puma-dev last week and couldn't get it working. I tracked it down today to Google's ownership of .dev and resolving addresses to 127.0.53.53, so I don't know why puma-dev uses .dev (yes, pow compatibility, except it doesn't work for anyone who didn't already have pow running).

I uninstalled puma-dev, re-installed specifying .test instead of .dev, tested it and did other things. When I came back, I couldn't get to #{site}.test - using ps I discovered that puma-dev had restarted on the .dev TLD. This is a bug - now I'm sitting around wasting time trying to figure out where the puma-dev launchd config is so I can fix this laziness.

Is puma required in Gemfile?

I installed the puma gem in the global gemset for the ruby, but puma-dev doesn't hook into it unless it's added to the app's Gemfile:

$ which puma
/Users/jaiken/.rvm/gems/ruby-2.3.1/bin/puma

$ puma-dev
* Directory for apps: /Users/jaiken/.puma-dev
* Domains: dev
* DNS Server port: 9253
* HTTP Server port: 9280
* HTTPS Server port: 9283
! Puma dev listening on http and https
! Booted app 'usertesting' on socket /Users/jaiken/.puma-dev/usertesting/tmp/puma-dev-12773.sock
usertesting[12823]: Using /Users/jaiken/.rvm/gems/ruby-2.3.1
usertesting[12823]: Using /Users/jaiken/.rvm/gems/ruby-2.3.1
/Users/jaiken/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:373:in `block in replace_bin_path': can't find executable puma (Gem::Exception)
    from /Users/jaiken/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:298:in `activate_bin_path'
    from /Users/jaiken/.rvm/gems/ruby-2.3.1/bin/puma:22:in `<main>'
    from /Users/jaiken/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/jaiken/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'

Is putting puma in the Gemfile required, or is this a bug?

Unable to install into system: exit status 1

Getting this Error when run puma-dev -install

Setup dev domains:
sudo puma-dev -setup

Install puma-dev as a launchd agent (required for port 80 usage):
puma-dev -install
==> Summary
🍺 /usr/local/Cellar/puma-dev/0.7: 2 files, 10.4M, built in 0 seconds
✝ ~ sudo puma-dev -setup
Password:

  • Configuring /etc/resolver to be owned by olabode
    ✝ ~ puma-dev -install
    2016/08/06 14:00:26 Unable to install into system: exit status 1

Any plans for Linux support?

The question probably for the devs.
Are there plans for Linux support? And if an answer is yes do you know how soon we will see this?

Why zsh?

I noticed zsh is the shell that is used. Couldn't be this just bash? Or even sh?

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.