class Foo
just create the class?
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
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
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...
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: 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: 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"=>fals
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@danilogarcia024 You might want to (in fact, I highly encourage you to) put long stack traces in a gist (https://gist.github.com) and link to it from here.
The warning is definitely something you want to address. You don't want to have your /usr/local/bin
directory to be world readable (permission bits 777
). The permissions 755
is much more reasonable for that directory (it says only the owner of that directory can write to it, but other users can read and execute binaries from within it). You can change the permissions via sudo chmod -r 755 /usr/local/bin
.
Can't help with debugging Invalid HTTP format
without knowing what exactly you're sending the server (do you have a sample curl
request?)