Eddie Cianci
2010-May-21 18:13 UTC
[Ironruby-core] Serving images using Rack + IIS + Rails?
Hi all, I''ve got a Windows 2008 / IIS 7 server, and a default Rails app working with: Rails 2.3.5 Rack gem (1.0.1) IronRuby 1.0 RTM IronRuby.Rack.dll built from Git HEAD. It seems like images are being corrupted? Static content like /javascripts/prototype.js looks fine, but I get a broken image when requesting /images/rails.png Running curl, the headers looked OK: HTTP/1.1 200 OK Cache-Control: private Content-Length: 6646 Content-Type: image/png; charset=utf-8 Last-Modified: Thu, 20 May 2010 18:50:34 GMT Server: Microsoft-IIS/7.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Fri, 21 May 2010 18:11:54 GMT (However, it displays correctly when using the local "ir script\server" (just webrick) http://localhost:3000/images/rails.png) (It looks like Bobby Johnson has the same or similar issue in his screencast @ http://www.iamnotmyself.com/2010/04/22/RunningRailsInIIS7WithIronRubyRack.aspx(15m 04s)) Any ideas? Thanks, Ed C. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100521/536e7e9f/attachment-0001.html>
Bobby Johnson
2010-May-21 18:38 UTC
[Ironruby-core] Serving images using Rack + IIS + Rails?
Hi Eddie, This is a known issue with the ironrack implementation. I had thought it was going to be fixed with the next push to github, but it looks like it was not. try searching the mailing list for jimmy''s comments on it. couple workarounds for you... 1. fix it... 8) 2. set up a images subdomain for hosting image files that does not go though rack. so all your images would come from images.mysite.com. On Fri, May 21, 2010 at 11:13 AM, Eddie Cianci <defeated2k4 at gmail.com>wrote:> Hi all, > > I''ve got a Windows 2008 / IIS 7 server, and a default Rails app working > with: > > Rails 2.3.5 > Rack gem (1.0.1) > IronRuby 1.0 RTM > IronRuby.Rack.dll built from Git HEAD. > > It seems like images are being corrupted? Static content like > /javascripts/prototype.js looks fine, but I get a broken image when > requesting /images/rails.png > > Running curl, the headers looked OK: > > HTTP/1.1 200 OK > Cache-Control: private > Content-Length: 6646 > Content-Type: image/png; charset=utf-8 > Last-Modified: Thu, 20 May 2010 18:50:34 GMT > Server: Microsoft-IIS/7.0 > X-AspNet-Version: 4.0.30319 > X-Powered-By: ASP.NET > Date: Fri, 21 May 2010 18:11:54 GMT > > (However, it displays correctly when using the local "ir script\server" > (just webrick) http://localhost:3000/images/rails.png) > > (It looks like Bobby Johnson has the same or similar issue in his > screencast @ > http://www.iamnotmyself.com/2010/04/22/RunningRailsInIIS7WithIronRubyRack.aspx(15m 04s)) > > Any ideas? > > Thanks, > Ed C. > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-- "The explanation requiring the fewest assumptions is most likely to be correct." - Occam?s Razor http://en.wikipedia.org/wiki/Occam''s_Razor -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100521/2c6b1270/attachment.html>
Eddie Cianci
2010-May-21 19:06 UTC
[Ironruby-core] Serving images using Rack + IIS + Rails?
Hi Bobby, I hadn''t seen anything on the Codeplex site, but I did just find this post from Jimmy @ http://www.ruby-forum.com/topic/208064#905769 (Apologies for beating a dead horse.) We''ll be using static asset hosts in production, so using them in development for the short term works too. Thanks! On Fri, May 21, 2010 at 2:38 PM, Bobby Johnson <bobby.johnson at gmail.com>wrote:> Hi Eddie, > > This is a known issue with the ironrack implementation. I had thought it > was going to be fixed with the next push to github, but it looks like it was > not. try searching the mailing list for jimmy''s comments on it. couple > workarounds for you... 1. fix it... 8) 2. set up a images subdomain for > hosting image files that does not go though rack. so all your images would > come from images.mysite.com. > > On Fri, May 21, 2010 at 11:13 AM, Eddie Cianci <defeated2k4 at gmail.com>wrote: > >> Hi all, >> >> I''ve got a Windows 2008 / IIS 7 server, and a default Rails app working >> with: >> >> Rails 2.3.5 >> Rack gem (1.0.1) >> IronRuby 1.0 RTM >> IronRuby.Rack.dll built from Git HEAD. >> >> It seems like images are being corrupted? Static content like >> /javascripts/prototype.js looks fine, but I get a broken image when >> requesting /images/rails.png >> >> Running curl, the headers looked OK: >> >> HTTP/1.1 200 OK >> Cache-Control: private >> Content-Length: 6646 >> Content-Type: image/png; charset=utf-8 >> Last-Modified: Thu, 20 May 2010 18:50:34 GMT >> Server: Microsoft-IIS/7.0 >> X-AspNet-Version: 4.0.30319 >> X-Powered-By: ASP.NET >> Date: Fri, 21 May 2010 18:11:54 GMT >> >> (However, it displays correctly when using the local "ir script\server" >> (just webrick) http://localhost:3000/images/rails.png) >> >> (It looks like Bobby Johnson has the same or similar issue in his >> screencast @ >> http://www.iamnotmyself.com/2010/04/22/RunningRailsInIIS7WithIronRubyRack.aspx(15m 04s)) >> >> Any ideas? >> >> Thanks, >> Ed C. >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > > > -- > "The explanation requiring the fewest assumptions is most likely to be > correct." > > - Occam?s Razor > http://en.wikipedia.org/wiki/Occam''s_Razor > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100521/b8ddb9e5/attachment.html>
Jimmy Schementi
2010-May-21 21:31 UTC
[Ironruby-core] Serving images using Rack + IIS + Rails?
Yep, this is a known bug in the current sources; we used response.Write instead of response.WriteBinary. If you change Hosts/IronRuby.Rack/Response.cs to use that, images and other binary files will work again. Also, it''s another bug that the adapter is serving static files through Rack, it should just find them itself. This bug and the image bug will be checked in this weekend. Let me know if you have any issues. ~Jimmy On May 21, 2010, at 2:33 PM, "Eddie Cianci" <defeated2k4 at gmail.com<mailto:defeated2k4 at gmail.com>> wrote: Hi all, I''ve got a Windows 2008 / IIS 7 server, and a default Rails app working with: Rails 2.3.5 Rack gem (1.0.1) IronRuby 1.0 RTM IronRuby.Rack.dll built from Git HEAD. It seems like images are being corrupted? Static content like /javascripts/prototype.js looks fine, but I get a broken image when requesting /images/rails.png Running curl, the headers looked OK: HTTP/1.1 200 OK Cache-Control: private Content-Length: 6646 Content-Type: image/png; charset=utf-8 Last-Modified: Thu, 20 May 2010 18:50:34 GMT Server: Microsoft-IIS/7.0 X-AspNet-Version: 4.0.30319 X-Powered-By: <http://ASP.NET> ASP.NET<http://ASP.NET> Date: Fri, 21 May 2010 18:11:54 GMT (However, it displays correctly when using the local "ir script\server" (just webrick) <http://localhost:3000/images/rails.png> http://localhost:3000/images/rails.png) (It looks like Bobby Johnson has the same or similar issue in his screencast @ <http://www.iamnotmyself.com/2010/04/22/RunningRailsInIIS7WithIronRubyRack.aspx> http://www.iamnotmyself.com/2010/04/22/RunningRailsInIIS7WithIronRubyRack.aspx (15m 04s)) Any ideas? Thanks, Ed C. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100521/f0379c0b/attachment.html>