2010-04-15 12 views
5

¿Alguien más está jugando con ironruby?Aplicación Getting Rails que se ejecuta en IronRuby Rack

Conseguí exitosamente ejecutar el proyecto IronRuby.Rails.Example en mi máquina local bajo IIS 5.1. Ahora estoy intentando hacer funcionar mi propio sitio de demo rails de la misma manera.

Mi web.config es ligeramente diferente del proyecto de ejemplo. Estoy intentando usar solo lo que se distribuyó con IronRuby 1.0 y lo que he instalado usando gemas.

estoy recibiendo el siguiente error que no me da mucho para ir en:

D: /demo/config/boot.rb: 66: en `salida ': salida (SystemExit)

Después de probar muchas cosas diferentes, creo que está teniendo un problema para encontrar gemas. He adjuntado mi configuración web y ironrack.log. ¿Alguien tiene consejos sobre lo que estoy haciendo mal?

Gracias!

<?xml version="1.0"?> 
<configuration> 
    <configSections> 
     <!-- custom configuration section for DLR hosting --> 
     <section name="microsoft.scripting" type="Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting" requirePermission="false"/> 
    </configSections> 
    <system.webServer> 
     <handlers> 
      <!-- clear all other handlers first. Don't do this if you have other handlers you want to run --> 
      <clear/> 
      <!-- This hooks up the HttpHandler which will dispatch all requests to Rack --> 
      <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="true"/> 
    <httpHandlers> 
     <!-- clear all other handlers first. Don't do this if you have other handlers you want to run --> 
     <clear/> 
     <!-- This hooks up the HttpHandler which will dispatch all requests to Rack --> 
     <add path="*" verb="*" type="IronRuby.Rack.HttpHandlerFactory, IronRuby.Rack" /> 
    </httpHandlers> 
    </system.web> 
    <!-- DLR configuration. Set debugMode to "true" if you want to debug your dynamic language code with VS --> 
    <microsoft.scripting debugMode="false"> 
     <options> 
      <!-- Library paths: make sure these paths are correct --> 
      <!--<set option="LibraryPaths" value="..\..\..\Languages\Ruby\libs\; 
                ..\..\..\..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p368\lib\ruby\site_ruby\1.8\; 
                ..\..\..\..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p368\lib\ruby\1.8\"/>--> 
      <set option="LibraryPaths" value="C:\IronRuby\lib\IronRuby;C:\IronRuby\lib\ruby\1.8;C:\IronRuby\lib\ruby\site_ruby;C:\IronRuby\lib\ruby\site_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="C:\IronRuby\Lib\ironruby\gems\1.8\gems"/> 
     <add key="RackEnv" value="production"/> 
    </appSettings> 
</configuration> 

=== Booting ironruby-rack at 4/15/2010 1:27:12 PM [DEBUG] >>> TOPLEVEL_BINDING = binding 
=> Setting GEM_PATH: 'C:\\IronRuby\\Lib\\ironruby\\gems\\1.8\\gems' 
=> Setting RACK_ENV: 'production' 
=> Loading RubyGems [DEBUG] >>> require 'rubygems' 
=> Loading Rack >=1.0.0 [DEBUG] >>> gem 'rack', '>=1.0.0';require 'rack' 
=> Loaded rack-1.1 
=> Application root: 'D:\\demo' 
=> Loading Rack application [DEBUG] >>> Rack::Builder.new { (
    require "config/environment" 

    ENV['RAILS_ENV'] = 'development' 

    use Rails::Rack::LogTailer 
    use Rails::Rack::Static 
    run ActionController::Dispatcher.new 
    ) }.to_app exit 
    D:/demo/config/boot.rb:66:in `exit': exit (SystemExit) 
     from D:/demo/config/boot.rb:66:in `load_rails_gem' 
     from D:/demo/config/boot.rb:54:in `load_initializer' 
     from D:/demo/config/boot.rb:38:in `run' 
     from D:/demo/config/boot.rb:11:in `boot!' 
     from D:/demo/config/boot.rb:110 
     from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' 
     from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' 
     from D:/demo/config/environment.rb:7 
     from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' 
     from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' 
     from (eval):1 
     from C:/IronRuby/lib/ironruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval' 
     from C:/IronRuby/lib/ironruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize' 
     from (eval):0 
     from D:\Dev\ironruby\ironruby-ironruby-20bc41b\Merlin\Main\Hosts\IronRuby.Rack\RubyEngine.cs:52:in `Execute' 
     from D:\Dev\ironruby\ironruby-ironruby-20bc41b\Merlin\Main\Hosts\IronRuby.Rack\RubyEngine.cs:45:in `Execute' 
     from D:\Dev\ironruby\ironruby-ironruby-20bc41b\Merlin\Main\Hosts\IronRuby.Rack\Application.cs:68:in `Rackup' 
     from D:\Dev\ironruby\ironruby-ironruby-20bc41b\Merlin\Main\Hosts\IronRuby.Rack\Application.cs:32:in `.ctor' 
     from D:\Dev\ironruby\ironruby-ironruby-20bc41b\Merlin\Main\Hosts\IronRuby.Rack\HttpHandlerFactory.cs:37:in `GetHandler' 
     from System.Web:0:in `MapHttpHandler' 
     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 `System.Web.IHttpAsyncHandler.BeginProcessRequest' 
     from System.Web:0:in `ProcessRequestInternal' 
     from System.Web:0:in `ProcessRequestNoDemand' 
     from System.Web:0:in `ProcessRequest' 

Respuesta

3

exit es la manera de dejar de fumar mediante programación en Ruby.

La idea detrás del rack es que se trata de un middleware entre los frameworks web de ruby ​​y el servidor de aplicaciones real. Desacoplando eso, permite que la miríada de frameworks de ruby ​​(rieles, sinatra, ramaze, etc.) se dirijan a una única interfaz, y la miríada de servidores de aplicaciones (mongrel, apache con pasajero, unicornio, etc.) hacen lo mismo. Lo que parece es que los chicos de IR están tratando de trabajar en rack con IIS. Hice un rápido google para los rieles en la configuración de rack, y encontré this page

el resultado es similar a lo que se ve en el método del servidor de rieles. Intentaría averiguar de dónde viene esto desde

require "config/environment" 

ENV['RAILS_ENV'] = 'development' 

use Rails::Rack::LogTailer 
use Rails::Rack::Static 
run ActionController::Dispatcher.new 
) }.to_app exit 

y tratar de hacerlo más cercano a lo que está en esa guía. Si no puede obtenerlo allí, trataría de publicar en la lista de correo de IR. Tienden a ser bastante amigables, y dado que esto es algo tan marginal en este momento, pueden ser los únicos con suficiente experiencia para ayudar.

Buena suerte :-)

+0

estaba en el camino correcto. Tenía instaladas las dos versiones Rack 1.0.1 y 1.1.0. Desinstalé 1.1.0 y ahora estoy llegando a un error de enrutamiento ... por lo que parece que estoy en el camino de enlighenment nuevamente. – NotMyself

+0

dulce, me alegro de haber podido ayudar :) –

+0

@NotMyself - Parece que estoy en el mismo camino que tú; Primero me encontré con el problema de 'salida' y la desinstalación de 1.1.0 también lo solucionó. ¿Pudo averiguar el error de enrutamiento? –

Cuestiones relacionadas