Code Monkey home page Code Monkey logo

puma-dev's Introduction

Puma-dev: A fast, zero-config development server for macOS and Linux

ci report

Puma-dev is the emotional successor to pow. It provides a quick and easy way to manage apps in development on macOS and Linux.

Highlights

  • Easy startup and idle shutdown of rack/rails apps
  • Easy access to the apps using the .test subdomain (configurable)
  • Run multiple custom domains at the same time, e.g. .test, .puma.

Why choose puma-dev?

  • https - it Just Works!
  • Supports Rails 5 actioncable via rack.hijack websockets
  • Supports macOS and Linux
  • The venerable pow is no longer maintained

Installation

First, ensure that the puma gem is installed. It probably belongs in the Gemfile of the application(s) you're trying to serve via puma-dev.

# Gemfile
gem 'puma'

Homebrew on macOS or GNU/Linux

brew install puma/puma/puma-dev

Pre-built Binaries

You may download binaries for macOS and Linux at https://github.com/puma/puma-dev/releases

Build from Source

#!/usr/bin/env bash

go version

go get github.com/puma/puma-dev/...
cd $GOPATH/src/github.com/puma/puma-dev/
make && make install

$GOBIN/puma-dev -V

macOS Support

Install & Setup

# Configure some DNS settings that have to be done as root
sudo puma-dev -setup
# Configure puma-dev to run in the background on ports 80 and 443 with the domain `.test`.
puma-dev -install

If you wish to have puma-dev use a port other than 80, pass it via the -install-port, for example to use port 81: puma-dev -install -install-port 81.

NOTE: If you installed puma-dev v0.2, please run sudo puma-dev -cleanup to remove firewall rules that puma-dev no longer uses (and will conflict with puma-dev working).

NOTE: If you had pow installed before in the system, please make sure to run pow's uninstall script. Read more details in the pow manual.

Uninstall

Run: puma-dev -uninstall

NOTE: If you passed custom options (e.g. -d test:localhost) to -setup, be sure to pass them to -uninstall as well. Otherwise /etc/resolver/* might contain orphaned entries.

Logging

When puma-dev is installed as a user agent (the default mode), it will log output from itself and the apps to ~/Library/Logs/puma-dev.log. You can refer to there to find out if apps have started and look for errors.

In the future, puma-dev will provide an integrated console for this log output.


Linux Support

Puma-dev supports Linux but requires the following additional installation steps to be followed to make all the features work (-install and -setup flags for Linux are not provided):

puma-dev root CA

The puma-dev root CA is generated (in ~/.puma-dev-ssl/), but you will need to install and trust this as a Certificate Authority by adding it to your operating system's certificate trust store, or by trusting it directly in your favored browser (as some browsers will not share the operating system's trust store).

First, start puma-dev to generate a CA certificate into ~/.puma-dev-ssl/cert.pem.

For Arch Linux, Fedora and other distributions using p11-kit, try this:

# convert from PEM to DER
openssl x509 -in ~/.puma-dev-ssl/cert.pem -outform der -out ~/.puma-dev-ssl/cert.crt

# store certificate as an anchor in the trust policy store
sudo trust anchor --store ~/.puma-dev-ssl/cert.crt

# verify
trust list --filter=ca-anchors | grep -i -C2 Puma-dev

For Debian, Ubuntu etc, try this:

sudo mkdir -p /usr/local/share/ca-certificates
sudo cp ~/.puma-dev-ssl/cert.pem /usr/local/share/ca-certificates/puma-dev-pem.crt
sudo update-ca-certificates

Domains (.test or similar)

On systems with systemd-resolved the .localhost extension will be available by default. Try ping some-domain.localhost to see if it works.

In order for requests to the .test (or any other custom) domain to resolve, install the dev-tld-resolver, making sure to use test (or the custom TLD you want to use) when configuring TLDs.

Port 80/443 binding

Linux prevents applications from binding to ports lower that 1024 by default. You don't need to bind to port 80/443 to use puma-dev but it makes using the .test domain much nicer (e.g. you'll be able to use the domain as-is in your browser rather than providing a port number)

There are 2 options to allow puma-dev to listen on port 80 and 443:

  1. Give puma-dev the capabilities directly:
sudo setcap CAP\_NET\_BIND\_SERVICE=+eip /path/to/puma-dev

or 2. Install authbind. and invoke puma-dev with it when you want to use it e.g.

authbind puma-dev -http-port 80 -https-port 443

There is a shortcut for binding to 80/443 by passing -sysbind to puma-dev when starting, which overrides -http-port and -https-port.

Systemd (running puma-dev in the background)

On Linux, puma-dev will not automatically run in the background (as per the MacOS -install script); you'll need to run it in the foreground. You can set up a system daemon to start up puma-dev in the background yourself.

  1. Create /lib/systemd/system/puma-dev.service and put in the following:
[Unit]
After=network.target

[Service]
User=$USER
ExecStart=/path/to/puma-dev -sysbind
Restart=on-failure

[Install]
WantedBy=multi-user.target

Replace path/to/puma-dev with an absolute path to puma-dev Replace the $USER variable with the name of the user you want to run under.

  1. Start puma-dev using systemd:
sudo systemctl daemon-reload
sudo systemctl enable puma-dev
sudo systemctl start puma-dev

On systems with SELinux you may have to run restorecon /path/to/puma-dev in order to run it.


Usage

Simply symlink your app's directory into ~/.puma-dev! That's it!

You can use the built-in helper subcommand: puma-dev link [-n name] [dir] to link app directories into your puma-dev directory (~/.puma-dev by default).

Options

Run: puma-dev -h

You have the ability to configure most of the values that you'll use day-to-day.

Advanced Configuration

Puma-dev supports loading environment variables before puma starts. It checks for the following files in this order:

  • ~/.powconfig
  • .env
  • .powrc
  • .powenv
  • .pumaenv

You can prevent puma-dev from loading any of these environment files by setting a corresponding environment variable to '0':

  • PUMADEV_SOURCE_POWCONFIG=0
  • PUMADEV_SOURCE_ENV=0
  • PUMADEV_SOURCE_POWRC=0
  • PUMADEV_SOURCE_POWENV=0
  • PUMADEV_SOURCE_PUMAENV=0

Additionally, puma-dev uses a few other environment variables to control how puma is started that you can overwrite in your loaded shell config.

  • CONFIG: A puma configuration file to load, usually something like config/puma-dev.rb. Defaults to no config.
  • THREADS: How many threads puma should use concurrently. Defaults to 5.
  • WORKERS: How many worker processes to start. Defaults to 0, meaning only use threads.

Important Note On Ports and Domain Names

  • Default privileged ports are 80 and 443
  • Default domain is .test.
    • Previously it was .dev, but it is owned by Google and since Dec 2017 HSTS only with real websites hosted there.
    • Don't use .dev and .foo, as they are real TLDs.
  • Using pow? To avoid conflicts, use different ports and domain or uninstall pow properly.

Restarting

If you would like to have puma-dev restart a specific app, you can run touch tmp/restart.txt in that app's directory.

Purging

If you would like to have puma-dev stop all the apps (for resource issues or because an app isn't restarting properly), you can send puma-dev the signal USR1. The easiest way to do that is:

puma-dev -stop

Running in the foreground

Run: puma-dev

Puma-dev will startup by default using the directory ~/.puma-dev, looking for symlinks to apps just like pow. Drop a symlink to your app in there as: cd ~/.puma-dev; ln -s /path/to/my/app test. You can now access your app as test.test.

Running puma-dev in this way will require you to use the listed http port, which is 9280 by default.

Coming from v0.2

Puma-dev v0.3 and later use launchd to access privileged ports, so if you installed v0.2, you'll need to remove the firewall rules.

Run: sudo puma-dev -cleanup

Coming from Pow

By default, puma-dev uses the domain .test to manage your apps. If you want to have puma-dev look for apps in ~/.pow, just run puma-dev -pow.

Sub Directories

If you have a more complex set of applications you want puma-dev to manage, you can use subdirectories under ~/.puma-dev as well. This works by naming the app with a hyphen (-) where you'd have a slash (/) in the hostname. So for instance if you access cool-frontend.test, puma-dev will look for ~/.puma-dev/cool-frontend and if it finds nothing, try ~/.puma-dev/cool/frontend.

Proxy support

Puma-dev can also proxy requests from a nice dev domain to another app. To do so, just write a file (rather than a symlink'd directory) into ~/.puma-dev with the connection information.

For example, to have port 9292 show up as awesome.test: echo 9292 > ~/.puma-dev/awesome.

Or to proxy to another host: echo 10.3.1.2:9292 > ~/.puma-dev/awesome-elsewhere.

HTTPS

Puma-dev automatically makes the apps available via SSL as well. When you first run puma-dev, it will have likely caused a dialog to appear to put in your password. What happened there was puma-dev generates its own CA certification that is stored in ~/Library/Application Support/io.puma.dev/cert.pem.

That CA cert is used to dynamically create certificates for your apps when access to them is requested. It automatically happens, no configuration necessary. The certs are stored entirely in memory so future restarts of puma-dev simply generate new ones.

When -install is used (and let's be honest, that's how you want to use puma-dev), then it listens on port 443 by default (configurable with -install-https-port) so you can just do https://blah.test to access your app via https.

Webpack Dev Server

If your app uses HTTPS then the Webpack Dev Server (WDS) should be run via SSL too to avoid browser "Mixed content" errors. While the WDS can generate its own certificates, these expire regularly and often need re-trusting in a new tab to avoid repeating console errors about /sockjs-node/info?t=123 that break the auto-reloading of assets via WDS.

To fix this leave WDS running in plain HTTP mode and combine Puma-dev's proxy and HTTPS features.

Here's how to configure Rails and the Webpacker gem, for an example app already running at https://blah.test:

  • Run echo 3035 > ~/.puma-dev/webpack.blah to set up the proxy to the WDS
  • Edit config/environments/development.rb to include one of the following:
# for webpacker-only projects
config.action_controller.asset_host = '//webpack.blah.test'

# for hybrid webpacker/sprockets projects
config.action_controller.asset_host = proc { |source| '//webpack.blah.test' if source.starts_with?('/packs') }
  • Edit config/webpacker.yml to match:
dev_server:
  https: false
  host: localhost
  port: 3035
  public: webpack.blah.test

You can now restart the app with puma-dev -stop and start WDS with bin/webpack-dev-server.

Websockets

Puma-dev supports websockets natively but you may need to tell your web framework to allow the connections.

In the case of rails, you need to configure rails to allow all websockets or websocket requests from certain domains. The quickest way is to add config.action_cable.disable_request_forgery_protection = true to config/environments/development.rb. This will allow all websocket connections while in development.

Do not use disable_request_forgery_protection in production!

Or you can add something like config.action_cable.allowed_request_origins = /(\.test$)|^localhost$/ to allow anything under .test as well as localhost.

xip.io/nip.io

Puma-dev supports xip.io and nip.io domains. It will detect them and strip them away, so that your test app can be accessed as test.A.B.C.D.xip.io.

Run multiple domains

Puma-dev allows you to run multiple local domains. Handy if you're working with more than one client. Simply set up puma-dev like so: puma-dev -install -d first-domain:second-domain.

Puma-dev supports domains, not just TLDs. puma-dev -install -d test:puma.dev will allow myapp.test and myapp.puma.dev to resolve correctly. But, of course, this would render the project webpage at https://puma.dev inaccessible.

Static file support

Like pow, puma-dev support serving static files. If an app has a public directory, then any urls that match files within that directory are served. The static files have priority over the app.

Subdomains support

Once a virtual host is installed, it's also automatically accessible from all subdomains of the named host. For example, a myapp virtual host could also be accessed at http://www.myapp.test/ and http://assets.www.myapp.test/. You can override this behavior to, say, point www.myapp.test to a different application: just create another virtual host symlink named www.myapp for the application you want.

Status API

Puma-dev is starting to evolve a status API that can be used to introspect it and the apps. To access it, send a request with the Host: puma-dev and the path /status, for example: curl -H "Host: puma-dev" localhost/status.

The status includes:

  • If it is booting, running, or dead
  • The directory of the app
  • The last 1024 lines the app output

Events API

Puma-dev emits a number of internal events and exposes them through an events API. These events can be helpful when troubleshooting configuration errors. To access it, send a request with the Host: puma-dev and the path /events, for example: curl -H "Host: puma-dev" localhost/events.

Development

To build puma-dev, follow these steps:

  • Install a recent version of golang
  • Clone the repo
  • Run go mod download
  • Run make build
  • Run ./puma-dev -V to use your new binary

Releasing & Packaging for Homebrew

Tagged builds (e.g v0.18.0) will automatically create pre-release with artifacts for use in the Homebrew formula.

All builds with passing tests will publish binaries that are saved for 90 days.

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

.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?

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?

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.

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).

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'

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.

`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.

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

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. 👹

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

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.

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

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.

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

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

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.

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.

Why zsh?

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

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?

`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

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.

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 😍😍😍😍😍😍😍😍

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

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.

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!

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?

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

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.

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?

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.

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

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.

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

[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.

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?

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.}

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

😄

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

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

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?

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.

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.