Τρίτη 28 Ιουνίου 2011

Rails on XAMPP automated setup (RoX)

This post will be in English because I know that there are people seeking in google how ruby on rails can be installed over xampp in Windows.

So, I came across various websites giving instructions of how this installation can be done. I must confess though, that this wasn't easy. The installation gave me a headache, especially the mysql installation. You think that a "gem mysql2 install" will work huh? Well think again...

Anyway, I made an easy 1-click installer (a batch file and a sfx archive can do the job) in order to help anyone who wants to "play" with rails on Windows with the convinient use of xampp. Its name is RoX (Rails On Xampp). Yeah I know, the name is like the coolest ever....





Instructions:
  • Install XAMPP (if you haven't already installed it) under the root of your hard disk. Eg. c:/xampp or d:/xampp etc
  • Run the install.bat (install.bat if you use the RoX installer will autorun)
  • Enter your XAMPP installation drive letter without ":\" when the installer asks you to. Eg. C 
  • Wait... 
  • The installation is complete! Create a new rails app and make a virtual host in your apache conf (listening on port 3000 for example) in order to visit your rails website. (look bellow for instructions).

What the RoX installer will install?
  • Ruby 1.9.2 (p180)
  • Latest Rails gem (3.0.9 at the time this readme was written)
  • Mysql2 gem 0.2.11
  • Some other necessary gems will be autoinstalled by rails 

How can I create a new Rails app? 
rails new c:/xampp/htdocs/ruby -d mysql


How can I make a virtual apache host in order to run my Rails websites?


Place this code at the bottom of C:\xampp\apache\conf\httpd.conf 
Listen 3000
LoadModule rewrite_module modules/mod_rewrite.so

# RUBY HOST
<virtualHost *:3000>
ServerName rails
DocumentRoot "c:/xampp/htdocs/ruby/public"
<Directory "c:/xampp/htdocs/ruby/public/">

Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi

</Directory>
</VirtualHost>

 
Any other thoughts?

 If you intend to use rails on Windows then do yourself a favor... install "Console". Console is an opensource alternative cmd enviroment. It comes close to the Linux console enviroment. Check it out from here.



Sources:
http://lifeofnavin.blogspot.com/2010/10/ror-on-windows-with-xampp.html
http://www.ruby-forum.com/topic/1321388
http://rorguide.blogspot.com/2011/03/installing-mysql2-gem-on-ruby-192-and.html
http://www.ruby-forum.com/topic/216873


Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου