IIS 8上使用HTTP平台处理程序的Rails 4?

crg*_*den 6 ruby iis ruby-on-rails-4

有没有人有微软HTTP平台处理程序 IIS扩展的经验呢?我正在关注几个月前写的这个很棒的教程,我已经安装了Ruby on Rails:

C:\> ruby -v
ruby 2.1.5p273 (2014-11-13 revision 48405) [i386-mingw32]

C:\> rails -v
Rails 4.1.2
Run Code Online (Sandbox Code Playgroud)

Rails从提示符启动并在端口3000运行正常:

C:\> rails s
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-05-01 02:42:49] INFO WEBrick 1.3.1
[2015-05-01 02:42:49] INFO ruby 2.1.5 (2014-11-13) [i386-mingw32]
[2015-05-01 02:42:49] INFO WEBrick::HTTPServer#start: pid=9448 port=3000
Run Code Online (Sandbox Code Playgroud)

这很棒,但每当我尝试浏览localhost/app(而不是localhost:3000)时,我都会感到害怕"我们很抱歉,但出了点问题."

这是我的应用程序的web.configIIS文件:

<?xml version="1.0"?>
<configuration>
    <system.webServer>      
      <handlers>
        <add
          name="httpplatformhandler"
          path="*"
          verb="*"
          modules="httpPlatformHandler"
          resourceType="Unspecified"
          requireAccess="Script" />
      </handlers>
      <httpPlatform
        stdoutLogEnabled="true"
        stdoutLogFile="rails.log"
        startupTimeLimit="200"
        processPath="c:\RailsInstaller\Ruby2.1.0\bin\ruby.exe"
        arguments="
          &quot;C:\Program Files\Windows Server\Bin\WebApps\Site\app\bin\rails&quot; server
          -p %HTTP_PLATFORM_PORT%
          -b 127.0.0.1">
      </httpPlatform>
    </system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)

事件查看器显示正确初始化Ruby的HTTP平台处理程序:

Process '10760' started successfully and is listening on port '2032'.
Run Code Online (Sandbox Code Playgroud)

Process Explorer显示w3wp.exe正在使用预期的参数运行Ruby:

ruby.exe 10760 c:\RailsInstaller\Ruby2.1.0\bin\ruby.exe "C:\Program Files\Windows Server\Bin\WebApps\Site\app\bin\rails" server -p 2032 -b 127.0.0.1
Run Code Online (Sandbox Code Playgroud)

我还可以看到Rails正在rails.log使用HTTP Platform Handler生成的文件:

=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://127.0.0.1:2032
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-05-02 12:23:44] INFO  WEBrick 1.3.1
[2015-05-02 12:23:44] INFO  ruby 2.1.5 (2014-11-13) [i386-mingw32]
[2015-05-02 12:23:45] INFO  WEBrick::HTTPServer#start: pid=10760 port=2032

Started GET "/app/" for [::1]:60449 at 2015-05-02 12:23:48 -0600
Run Code Online (Sandbox Code Playgroud)

但我得到一个500错误,我无法弄清楚为什么.这是IIS日志:

#Software: Microsoft Internet Information Services 8.5
#Version: 1.0
#Date: 2015-05-02 18:23:49
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2015-05-02 18:23:49 ::1 GET /app/ - 80 - ::1 Mozilla/5.0+(Windows+NT+6.3;+WOW64;+Trident/7.0;+rv:11.0)+like+Gecko - 500 0 0 146996
Run Code Online (Sandbox Code Playgroud)

所以有500.0错误.引用这个,我看到这意味着一个Module or ISAPI error occurred.但是这不是非常有用,所以我启用了失败的请求跟踪,这里是该日志的内容:

-MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName httpPlatformHandler
Notification EXECUTE_REQUEST_HANDLER
HttpStatus 500
HttpReason Internal Server Error
HttpSubStatus 0
ErrorCode The operation completed successfully.
          (0x0)
ConfigExceptionInfo
Run Code Online (Sandbox Code Playgroud)

我已经跑rake db:migrate了,我也被复制sqlite3.exe,sqlite3.def以及sqlite3.dllsystem32.有没有其他地方我可以找出导致此500错误的原因?