IronRuby on Rails 与 IIS 7
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
终于明白了。我必须卸载 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.