Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:44
    MSP-Greg commented #3069
  • 04:01
    MSP-Greg commented #3069
  • 03:48
    MSP-Greg commented #3069
  • 01:44
    xinghengwang edited #3069
  • 01:43
    xinghengwang edited #3069
  • 01:43
    xinghengwang opened #3069
  • 01:37

    MSP-Greg on master

    Update turbo-rails.yml (#3066) … (compare)

  • 01:37
    MSP-Greg closed #3066
  • 01:37
    MSP-Greg commented #3066
  • 01:36
    MSP-Greg commented #3066
  • 01:12
    MSP-Greg synchronize #3066
  • Jan 31 15:29
    MSP-Greg commented #3065
  • Jan 31 15:26
    MSP-Greg edited #3065
  • Jan 31 15:24
    MSP-Greg synchronize #3065
  • Jan 31 07:52
    rodzyn synchronize #2709
  • Jan 30 15:19
    fuele commented #3067
  • Jan 30 13:15
    choallin converted_to_draft #3068
  • Jan 30 06:58
    ioquatix commented #3007
  • Jan 30 06:30
    nateberkopec commented #3067
  • Jan 30 06:29
    nateberkopec commented #3007
Brian Shirai
@brixen
I didn't think you were being obnoxious or ungrateful :)
Mike Pastore
@mwpastore
Whew :-p
Brian Shirai
@brixen
heh
hopefully that clarifies how I think this should work
essentially, MRI can say that the mention of Foo in class Foo should trigger an autoload, but that's neither obvious nor sensible, IMO :)
Mike Pastore
@mwpastore
Just want to point out that the mention of Foo in class Foo does trigger an autoload in Rubinius, but only if it’s the first autoload of that symbol
Brian Shirai
@brixen
well, then you could have a potentially infinite recursion of autoload resolves
MRI needs to define the semantics of this
what if the Autoload you specify names the file itself?
what if it names a file that is already in $LOADED_FEATURES but didn't define Foo?
etc
Mike Pastore
@mwpastore
I thought require kept a hash of loaded files and won’t load a file twice
Brian Shirai
@brixen
exactly
so what happens when you specify a file that has been required for an autoload?
what if that file didn't define Foo
does the autoload fail?
does class Foo just create the class?
Mike Pastore
@mwpastore
mwp@aphrodite:~/src/rubinius-autoload$ ruby -v
rubinius 2.5.8 (2.1.0 bef51ae3 2015-09-28 3.4 JI) [x86_64-linux-gnu]
mwp@aphrodite:~/src/rubinius-autoload$ cat foo_loop.rb 
autoload :Foo, './foo_loop.rb’

class Foo
end
mwp@aphrodite:~/src/rubinius-autoload$ ruby foo_loop.rb
mwp@aphrodite:~/src/rubinius-autoload$ echo $?
0
Brian Shirai
@brixen
basically Rubinius just does whatever someone thought to write specs for
Ruby is extremely complex, under-specified, and poorly specified where it is
so, we'll see what MRI says
Mike Pastore
@mwpastore
Sounds good!
Chris
@ipatch
hello i'm trying to deploy a rails app with puma using cap, and trying to bind puma to a specific port and have set that in config/deploy/production.rb but the app isn't loading :/
raelik
@raelik
Is there a best practice for embedding a puma server into a multi-threaded ruby app? Namely, not using the puma cli
also, this would be on jruby, so no worries about the GIL getting in the way
Mike Pastore
@mwpastore
@raelik If you install the puma gem under JRuby doesn’t it just run puma using JRuby?
@raelik And if you’re deploying to another application server, do you even need puma?
raelik
@raelik
The app in question is a standalone jruby application, and puma would just be used to provide a json endpoint for monitoring it.
so I don't want to run the app with the puma command, as it already has its own command-line
raelik
@raelik
I've got a way to start it (Events.new, Binder.new & add_tcp_listener, Server.new), just didn't know if there was a more streamlined way
raelik
@raelik
actually, looks like I can call add_tcp_listener directly on the Server, since it'll create it's own Binder instance if necessary
so that'll work
Mike Pastore
@mwpastore
Interesting! I’ve seen other ways to do what you’re doing but that’s pretty cool
raelik
@raelik
    def puma_init
      conf = @config[:puma]
      events = case options[:log].nil?
        when false
          Puma::Events::DEFAULT
        else
          f = File.open(options[:log],'a+')
          e = Puma::Events.new(f, f)
          e.register(:state) {|s| f.close if s == :done }
          e
      end
      server = Puma::Server.new(@monitor,events)
      server.add_tcp_listener(conf[:host] || '127.0.0.1', conf[:port] || '9292')
      server.min_threads = 0
      server.max_threads = conf[:threads] || 1
      server
    end
that's my method for manually initializing puma
raelik
@raelik
@monitor is a rack app initialized elsewhere, @config is a YAML config parsed into a hash, and options comes from methadone.
Mike Pastore
@mwpastore
Anybody working on running Puma on Ruby 2.3 with --enable=frozen-string-literal? I’m trying to fix up enough of the built-in gems in the preview just to get rake test to go :-\
James Moriarty
@jamesmoriarty
Hey, anyone know what dependencies I need to install puma on apline linux. Thanks. :)
James Moriarty
@jamesmoriarty
apk add --no-cache git imagemagick make gcc libc-dev libxml2-dev libxslt-dev libffi-dev yaml-dev openssl-dev zlib-dev readline-dev
Worked but I think I can eliminate some of those.
Philip Champon
@flah00
hi-o, i'm wondering if anyone has run into issues with puma master reconnecting to active record, using preload_app! and before_fork disconnect!. All of my rails app disconnect, except for redmine, which reconnects after 1 - 2 days.
this is with puma-2.16.0, rails-4.2.5, and pg-0.18.4
danilogarcia024
@danilogarcia024
I trying to run my app
When I started it the following message appear me
But it's just in Production

MacBook-Pro-de-Danilo:apc-directory danilogarcia024$ rails s puma -e production
/Users/danilogarcia024/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.11.2/lib/bundler.rb:289: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/Users/danilogarcia024/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.11.2/lib/bundler.rb:289: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
=> Booting Puma
=> Rails 4.1.6 application starting in production on http://0.0.0.0:3000
=> Run rails server -h for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Puma 2.13.4 starting...

  • Min threads: 0, max threads: 16
  • Environment: production
  • Listening on tcp://0.0.0.0:3000
    2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>
    2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>

2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>

2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>

2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>

2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>

2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>
2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>fals

This does not say a Hint of what could be
danilogarcia024
@danilogarcia024
MacBook-Pro-de-Danilo:apc-directory danilogarcia024$ rails s puma -e production /Users/danilogarcia024/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.11.2/lib/bundler.rb:289: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 /Users/danilogarcia024/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.11.2/lib/bundler.rb:289: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 => Booting Puma => Rails 4.1.6 application starting in production on http://0.0.0.0:3000 => Runrails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Puma 2.13.4 starting...
  • Min threads: 0, max threads: 16
  • Environment: production
  • Listening on tcp://0.0.0.0:3000
    2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>
    2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}
    ---`