【发布时间】:2015-10-12 03:51:08
【问题描述】:
我有一个 ajax 调用正在发送到 /php/rsvp.php。由于某种原因,当此调用通过 Web 服务器时,index.html 会附加到路径上。该应用程序使用 puma 托管在 heroku 上。带有堆栈跟踪的日志如下:
2015-10-12T01:48:57.898961+00:00 heroku[router]: at=info method=POST path="/php/rsvp.php" host= request_id= fwd="" dyno=web.1 connect=1ms service=9ms status=500 bytes=168
2015-10-12T01:48:57.901579+00:00 app[web.1]: 2015-10-12 01:48:57 +0000: Rack app error: #<Errno::ENOTDIR: Not a directory @ rb_sysopen - /app/_site/php/rsvp.php/index.html>
2015-10-12T01:48:57.901635+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rack-jekyll-0.4.1/lib/rack/jekyll/helpers.rb:14:in `initialize'
2015-10-12T01:48:57.901639+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rack-jekyll-0.4.1/lib/rack/jekyll/helpers.rb:14:in `open'
2015-10-12T01:48:57.901640+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rack-jekyll-0.4.1/lib/rack/jekyll/helpers.rb:14:in `file_info'
2015-10-12T01:48:57.901642+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rack-jekyll-0.4.1/lib/rack/jekyll.rb:75:in `call'
2015-10-12T01:48:57.901644+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.9.1/lib/puma/configuration.rb:71:in `call'
2015-10-12T01:48:57.901645+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.9.1/lib/puma/server.rb:490:in `handle_request'
2015-10-12T01:48:57.901647+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.9.1/lib/puma/server.rb:361:in `process_client'
2015-10-12T01:48:57.901649+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.9.1/lib/puma/server.rb:254:in `block in run'
2015-10-12T01:48:57.901652+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.9.1/lib/puma/thread_pool.rb:92:in `call'
2015-10-12T01:48:57.901692+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.9.1/lib/puma/thread_pool.rb:92:in `block in spawn_thread'
我一直在查看 puma 和 rack-jekyll 函数来查找追加发生的位置,但没有一个条件是有意义的。我还没有找到关于这个问题的任何其他帖子,这让我觉得我正在监督一些简单的事情。 ajax 调用非常简单:
req = $.post( '/rsvp.php', $form.serialize(), function(data, status){});
我是否缺少一些配置来防止这种情况?我的 Gemfile、_config.yml、config.ru 等与 here 的相同。
【问题讨论】:
标签: php ajax heroku jekyll rack