1. Download Ruby (the Windows binary version, not the “one click installer” because it contains MySQL and Apache which we don’t need).
2. Extract the zip to
3. Add Ruby’s bin repertory in your PATH environment variable:
- Right click “Computer / Properties”.
- Click “Advanced System Settings”.
- Advanced tab / Environment Variables.
;C:\wamp\ruby\bin to the Path variable.
Installing Rails and the Mongrel server
Open the command line and type:
gem install rails
Create your first Rails app. by opening the command line from
C:\wamp\www\rails\ and typing:
Install the Mongrel server and Windows Mongrel service (make sure to run the command line as administrator):
gem install mongrel and gem install mongrel_service
Install a Windows service for your Rails app.:
mongrel_rails service::install -N ruby-hello -c c:\wamp\www\rails\hello -p 3001 -e development
Start your Mongrel service:
net start ruby-hello
You can now access your Rails app. at http://localhost:3001/
Integrating with Apache
Enable mod_proxy in httpd.conf
Open httpd.conf (c:\wamp\bin\apache\Apache2.x.x\conf\httpd.conf) and uncomment the following line:
LoadModule proxy_module modules/mod_proxy.so
Forward your traffic to your Mongrel server. Add the following text to your httpd.conf (or extra/httpd-vhosts.conf if its included in your httpd.conf):
ProxyPass / http://localhost:3001/
ProxyPassReverse / http://localhost:3001
Add hello.com to your hosts file:
c:\windows\system32\drivers\etc\hosts in Notepad and add the following line: 127.0.0.1 www.hello.com hello.com
You can now go to www.hello.com and it should load your Rails app !