Ruby installation on Windows June 10, 2006
Posted by Slobodan Kovacevic in : Programming, Ruby & Rails , trackbackRecently I’ve started playing around with Ruby and Ruby On Rails on our hosted server. Since I liked it a lot I have finally decided to try to install it on our local Windows server. While I was doing it I found that most of the online tutorials are not all completely accurate, i.e. they need a bit of tweaking… So I started logging every step I did.
- InstantRails – on my local machine I have a development environment with Apache, MySQL and PHP, so I wanted to try out Ruby without disturbing my current servers. I found that InstantRails does just that. It has Ruby, Rails, Apache and MySQL all rolled into one self installing package, so it’s great for quick testing. You can download it from InstantRails site and you should also browse around the site a bit to learn more about it.
- Installation – there is no installation. You only need to extract all files and run InstantRails.exe and follow setup instructions from that can be found on InstantRails Getting Started page.
- Apache clash – when I started InstantRails it started all servers and it appeared to work just fine (i.e. it didn’t show any error), until I tried it… Then I remembered that it might have problems with my other Apache server, so I stopped it and started InstantRails again.
- Test – I opened a browser and typed http://www.mycookbook.com (that’s a domain you should have added to your HOSTS file during setup; this URL is needed for sample application to function) and… Woohoo… First Ruby program that has been run on my computer and it has been done within 20 minutes. Although it worked for me I see on InstantRails Wiki that people have problems with it, but it seems that most of them are related to other servers already running (like I had with Apache).
- Nagging command prompt console – when you start up a Ruby application there is command prompt console that stays open while application is loaded. It’s not a big problem but it bugs me and makes me wonder how it would like if I had several Ruby applications loaded (as I often do, because my workstation acts as a local server too). Unfortunately, I haven’t found a way to remove the console.
- Extended “Hello World” application – now that everything is working it’s time to create a new test application. I found a tutorial on Site Point Get On Track with Ruby on Rails that explains how to create a rails application. If you follow it you will create a sample application without much fuss. Only problem I had is that it’s a bit focused on people working on Unix-like environments (i.e. Mac and Linux). Problem is that on Windows you cannot simply enter commands to command prompt like they do in tutorial. You have to prefix everything with ruby command. So when they write ./script/generate you need to write ruby script/generate (providing that you are in appropriate directory).
- More tutorials – I have found another InstantRails tutorial that is Windows specific Rolling with Ruby on [Instant]Rails, but it seems a bit confusing and quite long, so I still haven’t tested it.
This should be more then enough to get you started with Ruby and Rails on Windows machine. You will be able to get a taste of Ruby without having to disturb your current development environment too much. If you like it you can always go with full Ruby install, i.e. set it up so it works along side your current servers and other programming languages, such as PHP.
Comments»
“Nagging command prompt console” … As RUBYW.EXE is the “no console” version of RUBY.EXE, configure Rails to run RUBYW.EXE rather than RUBY.EXE. Or simply rename C:\InstantRails\ruby\bin\RUBYW.EXE to RUBY.EXE (after having renamed the original RUBY.EXE to something else) . I’m no RoR expert, but this latter step worked for me.
Hi Mully, that’s a great tip. I will have to try it to remove the console window. Thanks.
The Sitepoint tutorial would for for windows environments except for one thing - who install sqliteX (where x is the version number)?