Welcome to MSDN Blogs Sign in | Join | Help

basketweaving for the mind

Microsoft, Open source, Web and other random stuff from one of Microsoft's Professonal Geeks

Syndication

News

Contact me

microformats hcard approaching

is a Professional Geek for Microsoft Australia. More info lives underneath my personal blog's About...

33.831416, 151.222526
MrCell+61.417.212181
Work:
1 Epping Road
North Ryde, NSW 2113
Australia
photo of nick hodge

Blog Flair

View Nick Hodge's profile on LinkedIn

msdn channel 9


Windows 7, IIS 7.5 and Ruby on Rails

Having spent the weekend working on Ruby on Rails with IIS/SQLServer 2008 Express backend via FastCGI, here are some tips to get you going:

  1. The best resource is Ruslan’s post on Rails and IIS7. In fact, go and bookmark this site right now. In Ruslan’s post, the web.config shown is best edited in a text editor.
  2. When installing IIS7.5 on Windows 7 Beta (build 7000) is easy: Using the Control Panels\Programs, Turn Windows Features On/Off. Underneath the Internet Information Services, you need to also install the CGI feature (to get FastCGI)
  3. Windows 7 and URL Rewrite: This forum post http://forums.iis.net/t/1154240.aspx will get you going whilst Windows 7 is in beta
  4. Database connectivity to SQLServer seems to be a common question. Installing the option “sqlserver adaptor” which is now an optional part of ActiveRecord:
    gem install activerecord-sqlserver-adapter --source=http://gems.rubyonrails.org
    Connecting via the ODBC adaptor via the SQL Native Client worked, rather than the ADO connector. My connector string looked something like this:
    development: 
      adapter: sqlserver 
      mode: odbc 
      dsn: Driver={SQL Native Client};Server=.\SQLEXPRESS;Database=xxxxx;
  5. As I am installing underneath the IIS7 root directory (that is: http://server/myapp) there are 3 small Rails tweaks required inform the application all the goodies are in a subdirectory:

    in config/environment.rb, the header, define a global variable:
    PATH_PREFIX = '/myapp'

    in config/environment.rb, in the Initializer, set the asset home directory:

    Rails::Initializer.run do |config|
        config.action_controller.asset_host = PATH_PREFIX

    in config/routes.rb, ActionController::Routing::Routes.draw:

      map.connect PATH_PREFIX + '/:controller/:action/:id'
      map.connect PATH_PREFIX + '/:controller/:action/:id.:format'
    end

Published Monday, February 23, 2009 2:50 PM by nhodge

Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# IIS7.5, Server Farms and Ruby @ Tuesday, February 24, 2009 4:20 AM

(Caution: Ruby application names are as prolific, esoteric and funny as Microsoft code names) The previous

basketweaving for the mind

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
Page view tracker