IronRuby on Rails 与 IIS 7

发布于 2024-09-10 22:59:14 字数 5248 浏览 7 评论 0原文

我正在尝试使用 IronRuby 构建一个在 IIS 7 上运行的 Rails 应用程序。我遵循了 IronRuby 网站上给出的所有教程,但我似乎无法让它工作。该应用程序在 WebBrick 下托管运行良好,但 IIS 似乎无法正确托管它。这是我得到的页面。

Error: exit

C:/repositories/RampUp/ruby/RampUp/config/boot.rb:66:in `exit': exit (SystemExit)
    from C:/repositories/RampUp/ruby/RampUp/config/boot.rb:66:in `load_rails_gem'
    from C:/repositories/RampUp/ruby/RampUp/config/boot.rb:54:in `load_initializer'
    from C:/repositories/RampUp/ruby/RampUp/config/boot.rb:38:in `run'
    from C:/repositories/RampUp/ruby/RampUp/config/boot.rb:11:in `boot!'
    from C:/repositories/RampUp/ruby/RampUp/config/boot.rb:110
    from C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from C:/repositories/RampUp/ruby/RampUp/config/environment.rb:7
    from C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from (eval):1
    from C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    from C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    from (eval):0
    from IronRuby.Rack:0:in `Rackup'
    from IronRuby.Rack:0:in `.ctor'
    from IronRuby.Rack:0:in `GetHandler'
    from System.Web:0:in `System.Web.HttpApplication.IExecutionStep.Execute'
    from System.Web:0:in `ExecuteStep'
    from System.Web:0:in `ResumeSteps'
    from System.Web:0:in `BeginProcessRequestNotification'
    from System.Web:0:in `ProcessRequestNotificationPrivate'
    from System.Web:0:in `ProcessRequestNotificationHelper'
    from System.Web:0:in `ProcessRequestNotification'
    from System.Web:0:in `MgdIndicateCompletion'
    from System.Web:0:in `ProcessRequestNotificationHelper'
    from System.Web:0:in `ProcessRequestNotification'


Search paths

C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/activerecord-2.3.8/bin
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/activerecord-2.3.8/lib
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/activesupport-2.3.8/bin
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/activesupport-2.3.8/lib
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/rake-0.8.7/bin
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/rake-0.8.7/lib
C:/repositories/RampUp/ruby/RampUp
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/rack-1.2.1/bin
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/rack-1.2.1/lib
C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/IronRuby/
C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ruby/site_ruby/1.8/
C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ruby/1.8/
.

Gem paths

C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8
C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ironruby/gems/1.8

这是我的 web.config

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="microsoft.scripting" type="Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting" requirePermission="false"/>
  </configSections>
  <system.webServer>
    <handlers>
      <clear/>
      <add name="IronRuby" path="*" verb="*" type="IronRuby.Rack.HttpHandlerFactory, IronRuby.Rack" resourceType="Unspecified" requireAccess="Read" preCondition="integratedMode"/>
    </handlers>
  </system.webServer>
  <system.web>
    <!-- make this true if you want to debug any of the DLR code, IronRuby.Rack, or your own managed code -->
    <compilation debug="false"/>
  </system.web>
  <microsoft.scripting debugMode="true">
    <languages>
      <language names="IronRuby;Ruby;rb" extensions=".rb" displayName="IronRuby 1.0" type="IronRuby.Runtime.RubyContext, IronRuby, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </languages>
    <options>
      <set language='Ruby' option="LibraryPaths" value=";..\IronRuby\lib\IronRuby\;..\IronRuby\lib\ruby\site_ruby\1.8\;..\IronRuby\lib\ruby\1.8\"/>
    </options>
  </microsoft.scripting>
  <appSettings>
    <add key="AppRoot" value="..\."/>
    <add key="Log" value="ironrack.log"/>
    <!-- <add key="GemPath" value="..\..\..\..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p368\lib\ruby\gems\1.8"/> -->
    <add key="GemPath" value="..\IronRuby\Lib\ironruby\gems\1.8"/>
    <add key="RackEnv" value="development"/>
  </appSettings>
</configuration>

和 config.ru 文件,

# RAILS_ROOT/config.ru
require "config/environment"

ENV['RAILS_ENV'] = 'development'

use Rails::Rack::LogTailer
use Rails::Rack::Static
run ActionController::Dispatcher.new

我不确定我做错了什么。有什么建议吗?

I'm trying to get a Rails app built with IronRuby running on IIS 7. I followed all the tutorial given on the IronRuby site but I can't seem to get it to work. The app runs fine hosted under WebBrick but IIS doesn't seem to host it properly. Here is the page I get.

Error: exit

C:/repositories/RampUp/ruby/RampUp/config/boot.rb:66:in `exit': exit (SystemExit)
    from C:/repositories/RampUp/ruby/RampUp/config/boot.rb:66:in `load_rails_gem'
    from C:/repositories/RampUp/ruby/RampUp/config/boot.rb:54:in `load_initializer'
    from C:/repositories/RampUp/ruby/RampUp/config/boot.rb:38:in `run'
    from C:/repositories/RampUp/ruby/RampUp/config/boot.rb:11:in `boot!'
    from C:/repositories/RampUp/ruby/RampUp/config/boot.rb:110
    from C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from C:/repositories/RampUp/ruby/RampUp/config/environment.rb:7
    from C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from (eval):1
    from C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    from C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    from (eval):0
    from IronRuby.Rack:0:in `Rackup'
    from IronRuby.Rack:0:in `.ctor'
    from IronRuby.Rack:0:in `GetHandler'
    from System.Web:0:in `System.Web.HttpApplication.IExecutionStep.Execute'
    from System.Web:0:in `ExecuteStep'
    from System.Web:0:in `ResumeSteps'
    from System.Web:0:in `BeginProcessRequestNotification'
    from System.Web:0:in `ProcessRequestNotificationPrivate'
    from System.Web:0:in `ProcessRequestNotificationHelper'
    from System.Web:0:in `ProcessRequestNotification'
    from System.Web:0:in `MgdIndicateCompletion'
    from System.Web:0:in `ProcessRequestNotificationHelper'
    from System.Web:0:in `ProcessRequestNotification'


Search paths

C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/activerecord-2.3.8/bin
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/activerecord-2.3.8/lib
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/activesupport-2.3.8/bin
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/activesupport-2.3.8/lib
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/rake-0.8.7/bin
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/rake-0.8.7/lib
C:/repositories/RampUp/ruby/RampUp
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/rack-1.2.1/bin
C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8/gems/rack-1.2.1/lib
C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/IronRuby/
C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ruby/site_ruby/1.8/
C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ruby/1.8/
.

Gem paths

C:/repositories/RampUp/ruby/RampUp/IronRuby/Lib/ironruby/gems/1.8
C:/repositories/RampUp/ruby/RampUp/IronRuby/lib/ironruby/gems/1.8

Here is my web.config

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="microsoft.scripting" type="Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting" requirePermission="false"/>
  </configSections>
  <system.webServer>
    <handlers>
      <clear/>
      <add name="IronRuby" path="*" verb="*" type="IronRuby.Rack.HttpHandlerFactory, IronRuby.Rack" resourceType="Unspecified" requireAccess="Read" preCondition="integratedMode"/>
    </handlers>
  </system.webServer>
  <system.web>
    <!-- make this true if you want to debug any of the DLR code, IronRuby.Rack, or your own managed code -->
    <compilation debug="false"/>
  </system.web>
  <microsoft.scripting debugMode="true">
    <languages>
      <language names="IronRuby;Ruby;rb" extensions=".rb" displayName="IronRuby 1.0" type="IronRuby.Runtime.RubyContext, IronRuby, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </languages>
    <options>
      <set language='Ruby' option="LibraryPaths" value=";..\IronRuby\lib\IronRuby\;..\IronRuby\lib\ruby\site_ruby\1.8\;..\IronRuby\lib\ruby\1.8\"/>
    </options>
  </microsoft.scripting>
  <appSettings>
    <add key="AppRoot" value="..\."/>
    <add key="Log" value="ironrack.log"/>
    <!-- <add key="GemPath" value="..\..\..\..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p368\lib\ruby\gems\1.8"/> -->
    <add key="GemPath" value="..\IronRuby\Lib\ironruby\gems\1.8"/>
    <add key="RackEnv" value="development"/>
  </appSettings>
</configuration>

and my config.ru file

# RAILS_ROOT/config.ru
require "config/environment"

ENV['RAILS_ENV'] = 'development'

use Rails::Rack::LogTailer
use Rails::Rack::Static
run ActionController::Dispatcher.new

I'm not sure what I am doing wrong. Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何以心动 2024-09-17 22:59:14

终于明白了。我必须卸载 Rails 2.3.8 和 Rack 1.1 并安装 Rails 2.3.5 和 Rack 1.0.1 我猜我正在运行的 IronRuby 版本(1.0)与较新版本的 Rails 存在问题。无论如何,我这样做之后它就起作用了。

Finally got it. I had to uninstall Rails 2.3.8 and Rack 1.1 and install Rails 2.3.5 and Rack 1.0.1 I guess the version of IronRuby I'm running (1.0) has issues with the newer version of rails. Anyways It worked after I did that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文