views:

876

answers:

2

Does anyone have clear instruction for setting up jRuby to work with IIS.

Edit:

What I'm looking for is step by step instructions for getting a Ruby on Rails application working on Windows using IIS and jRuby. The reason being is because I can't find anything other then "use Linux" when asking the question out in the wild. For most people Windows is the primary development and deployment environment so using a Linux based server is out of the question. Also IIS is included with Windows and provide superior integration with Active Directory so using Apache is out of the question also.

Last thing is using war files is a nightmare, please include instructions on how to deploy a rails apps by just copying the files or anything other then using war files.

+5  A: 

You need first to install Tomcat. See this how-to for setting up Tomcat together with IIS.

With JRuby you are going to build WAR files. Just drop these into Tomcat's webapps folder and you are ready to go.

Update: Ok, you need to integrate two technologies that weren't meant to be used together: IIS and JRuby. The good thing is that JRuby is both Java and Ruby and you can use the best from both worlds. Ruby is more productive and fun to code with, but Java is better for deployment (especially when need to do so with IIS). So my advice still holds. Create a war file, install Tomcat and deploy the war file there. Deploying the war file is as easy as copying it in the webapps folder. These are the steps you need to follow:

  • Install Tomcat
  • Integrate Tomcat with IIS using the ISAPI plug-in (I can help if you need more info on this)
  • Create a WAR file (Netbeans IDE can do that for you)
  • Copy the WAR file to the webapps folder of Tomcat

If you still do not want to use WAR files have a look at this blog spot. It describes how you can run RoR with IIS. I believe that for JRuby the procedure would be just the same. Anyway, a CGI approach is the only way if you want to avoid WAR files.

kgiannakakis
Yeah the important thing to note is jRuby compiles to Java byte code. So unless I am mistaken, all you need is a Java servlet container with the appropriate jRuby war files.
James McMahon
WAR files for JRuby deployment is what http://rubyonrails.org/deploy recommends
kgiannakakis
+5  A: 
Vinay Sajip
ok. i'll forget the war file thing. if you post instructions for getting jruby connected to iis using glassfish, i will accept your answer and give you the bounty. sorry i'm being such a pain about this, but i want a place for people to find these instruction in one place.
rip747
Is it just me that thinks this answer demonstrates SO's bounty system really working? Imagine how much you would have to pay someone to get this level of information?
DanSingerman
Actually, Dan, it so happens that I had to do a similar setup (though not with Glassfish) for another project. True, I have put a bit of effort into this answer, but it's for my own future reference, too. I've easily found this level of information on people's blogs where there's no bounty involved, and there's no doubt that the bounty is nice to have. But it's not worth spending the time *just* for the bounty.
Vinay Sajip
make sure that JAVA_HOME is also in your path or will get "The system cannot find the path specified" when trying to run jruby
rip747
another thing to make sure is that the sqlite gem is installed, otherwise you will be casing your tail with errors. issue this command right after installing rails:jruby -S gem install activerecord-jdbcsqlite3-adapter
rip747
Yes, I didn't mention this part as I didn't know you were using SQLite. Also worth looking at Nick Sieger's activerecord-jdbc-adapter (http://github.com/nicksieger/activerecord-jdbc-adapter/tree/master) for use with other JDBC-compliant databases.
Vinay Sajip