puma / puma-dev Goto Github PK
View Code? Open in Web Editor NEWA tool to manage rack apps in development with puma
License: BSD 3-Clause "New" or "Revised" License
A tool to manage rack apps in development with puma
License: BSD 3-Clause "New" or "Revised" License
Hi,
Pow has a useful feature where it will serve static files in the public
directory of an application. No other setup is required besides having the directory in place. Would this be a good fit for puma-dev?
Loving puma-dev, thanks!
SSL support is amazing (mind-blowing even), but upon enabling Rails's force_ssl
in development mode. It looks like the protocol isn't being passed along to Rails.
Does X-Forwarded-Proto: https
need to be set?
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!
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?
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:
puma-dev
started hitting 50-60% CPU usage and staying there.Killing the main puma-dev process and letting it restart brings everything back to normal (for now, at least).
As per http://pow.cx/manual.html#section_2.1.4
Allows for still using *.dev when you start rails and a bunch of other stuff with foreman or want to proxy to a non rails project.
Many thanks for this project!
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.
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.
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
Normally with Pow, http://myapp.192.168.1.3.xip.io loads up http://myapp.dev, which is very useful for testing on a connected iOS device. xip.io was built by the creators of Pow to be used with it so I figure if puma-dev is supposed to replace Pow, it would be really handy if you could support this as well.
Right now I'm running the v0.7 release and when I visit http://myapp.192.168.1.3.xip.io I see "unknown app" in a 500 response. Visiting http://myapp.dev works just fine.
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
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
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'
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
I noticed zsh is the shell that is used. Couldn't be this just bash? Or even sh?
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 😍😍😍😍😍😍😍😍
Hi @evanphx - happy to see this project underway!
May I suggest using launch_socket_server instead of a firewall rule to bind to port 80? I designed it to be used with Pow, but never got around to bundling it in an official Pow release.
Been going in circles trying to get this installed... Had pow before, removed it before starting.
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 ಠ_ಠ ➜ ~
Homebrew 0.9.9 (git revision a5a93; last commit 2016-07-31)
jaiken@firefly ➜ ~ cat /etc/resolver/dev
# Generated by puma-dev
nameserver 127.0.0.1
port 9253
Lots and lots and lots of Unable to expand dir: exit status 1
's
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?
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 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:
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
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?
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.
If puma-dev
is already in ~/bin
, puma-dev -install
fails.
...it might be worth specifying that? Or maybe detecting if it is and continuing if the files are the same?
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
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
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
.
I would be great to be able to configure puma-dev puma servers by custom config files like you can with standalone puma. For example: config/puma.rb
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
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
How do we go from a checkout of this to a running executable?
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
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:
Would be great to have SSL support (self-signed totally fine) out of the box, being able to visit the page SSL or not.
See https://github.com/rchampourlier/tunnelss
(and very timely eg. https://blog.phusion.nl/2016/07/27/using-ssl-with-passenger-in-development-on-macos/)
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.
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.
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?
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 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.
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. 👹
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?
...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
😄
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?
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.}
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?
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.
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.