May 17, 2009
ROR on Xampp on Win
For those who don’t understand the title don’t worry, this is a “technical” post: installing Ruby on Rails (ROR) over an existing XAMPP (Apache, PHP, MySQL, …) installation in Windows. For all of those who have somehow a Windows “server” used to test websites and want to install Ruby and the fantastic Ruby on Rails framework.
Prerequisites: a working installation of XAMPP, in my example installed under: C:\xampp.
- Install ROR via the “one click installer” which can be found on the ROR site: installers list. To have everything in one “web-development directory” when prompted by the installer choose C:\xampp\ruby
- Open the dreaded DOS-prompt or cmd: Start->Run->cmd
- First off update gem, The version installed will stop whenever an update fails, to solve this update gem first. Let’s navigate to the ruby bin directory:
cd C:\xampp\ruby\bin
and then the command:gem update --system - Now all the gems are updated, install rails with this command:
gem install rails --include-dependencies
This will take a while especially for generating the whole documentation, don’t worry, everything is going all right, wait and be patient - Create a test application with the command:
rails C:/xampp/htdocs/testapp
If all went fine you will see some output saying that some files have been created. Rails is installed all fine - Now it’s time to create a Virtual Host in apache to test out our installation. Edit the file: C:xamppapacheconfextrahttpd-vhosts.conf with your favourite good editor. I always have installed Notepad++ and at the end add the following lines:
## ROR Listen 3000 <VirtualHost *:3000> ServerName ROR DocumentRoot "C:\xampp\htdocs" <Directory "C:\xampp\htdocs"> Options ExecCGI FollowSymLinks AllowOverride all Allow from all Order allow,deny AddHandler cgi-script .cgi AddHandler fastcgi-script .fcgi </Directory> </VirtualHost> ## END-ROR
- Restart apache from the XAMPP control panel and then go, on your favorite browser to:
http://localhost:3000/testapp/public
To see if everything went fine, the page should look like this screenshot
Versions
At the moment of this writing this is the list of version numbers for the installed applications running and working as configured in this post:
- XAMPP: 1.6.6a
- ruby -v: ruby 1.8.6 <2008-08-11 patchlevel 287> [i386-mswin32]
- gem -v: 1.3.3
- rails -v: Rails 2.3.2
I would like to thank the author of this post which is the starting point of my post. I just did some minor changes to remove some errors, especially when updating gems. Also I changed the file to edit to add the Virtual Host to keep things more clean in the http.conf file.
For any trouble don’t hesitate to contact me!

i have a working installation of XAMPP, and a working installation of ror INDEPENDENTLY. but i can’t make it working of ror in XAMPP.
can u guys plz give a assistance to make it
regards,
Manik
Hi,
I’m sorry but I’ve long stopped working with Windows machines. Sorry!
any issues with windows machines while hosting ror apps using XAMPP.
regards,
Manik
Hi,
then is it suitable to host in linux?
Regards,
Manik
Just wanted to say that I’ve tried several guides for several days and this is the only one that I got working on Windows 7. Thanks so much for the guidance.
Glad to hear that it’s still working in Windows 7!
i just have one question… the cmd isn’t letting me generate anything. When I use rails generate it says something about an sqlite3.dll is missing from my computer, even though i’m using mysql. I tried reinstalling SQLite gem but I get the same thing.
Any ideas?
have you tried developing after the last step.
I created a controller named say and created an action named hello
then I typed http://localhost/rubyapp/public/say/helllo
and this didn’t displayed the “hello” message.
This is very helpful, thanks.
A couple of points I noted:
1. On running the
gem install rails –include-dependencies
command, this errored four times with “http://gems.rubyforge.org does not appear to be a repository” and ErrNo:ENOTCONN before completing successfully on the fifth attempt.
2. At step 6 I think you’ve lost your slashes – the file to edit should be:
c:\xampp\apache\conf\extra\httpd-vhosts.conf