Ruby? Rails? Keretapi Tanah Melayu? Doesn't make sense? http://www.rubyonrails.org for explanation.
If you are new to ROR and want to find out about installing it on Windows, here it goes.
Before that, here are some other tutorials for your reference.
- http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html
- http://allaboutruby.wordpress.com/2006/01/09/installing-rails-on-windows-step-by-step-tutorial/
But the above URL uses those all-in-one installers. I hate those all-in-one installers. Where is the fun? So, this tutorial is for those developers who are looking to install each package separately.
Actually the steps are outlined at http://www.rubyonrails.org/down. Just follow them. Also, I didn't thought of screen capturing the installation. So most of the steps here are text based.
Step 1: Downloads all the necessary stuff
- Head to http://www.rubyonrails.org/down
- Download Ruby from http://rubyforge.org/frs/?group_id=167. You can download this http://rubyforge.iasi.roedu.net/files/rubyinstaller/ruby186-25.exe. At the time of writing, Ruby is at version 1.86.
- Download RubyGem from http://rubyforge.org/frs/?group_id=126. You can download this - http://rubyforge.org/frs/download.php/20990/rubygems-0.9.4.zip. RubyGem is a packager for Ruby. You need this to run many stuff later on. At the time of writing, RubyGem is at version 0.9.4.
- Next is MySQL. Head to http://dev.mysql.com/downloads/mysql/5.0.html#win32. Download MySql 5.0 Community Server. I assume you are not running enterprise level application. Download the Windows Essential version. http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-essential-5.0.41-win32.msi/from/http://mysql.oss.eznetsols.org/
- Your download folder should look something like below:-
- Run ruby186-25.exe. It will do all the installation. Just sit tight. Once its done, go to your search box and type in cmd. Once the command prompt screen pops up, type this "cd c:\ruby\bin" (I assume you have installed Ruby in C drive). Then type "ruby -v". If you have installed correct, it will show the version. If not, you have to reinstall Ruby again.
- Excellent. Now lets install RubyGem. Unzip rubygems-0.9.4.zip. Click on setup.rb. The setup will run in command window.
- Once done, now you need to run post-install.rb. This will create the RUBYOPT environment variable to the value rubygems in Windows. More information at http://docs.rubygems.org/read/chapter/3.
- Well, we are done with RubyGem, now Rails. Open the command prompt window. Type "c:\ruby\bin ". Now type this "gem install rails --include-dependencies". What happens now that it will fetch the latest Rails framework from http://gems.rubyforge.org/ .
- Don't worry if its slow and looks like its hanged, its downloading. There is a standalone package, but I haven't tried installing it that way. Once done you will see the screen as below (look at the 3rd last line in the screen):-
- Now is MySQL. Unzip mysql-5.0.41-win32.zip and run the setup.exe. I am not going to explain on the steps here. You can refer to to section II of http://allaboutruby.wordpress.com/2006/01/09/installing-rails-on-windows-step-by-step-tutorial/
- Thats it. Your done! You are ready to launch your Ruby application. Just to note, your Ruby application file can reside other drives either than C.
Step 3: Create and Run!
- To create your application, open up the command prompt. Assuming its at D drive, type "D:\", then "mkdir projects", then "cd projects", then "rails myfirstproject". (You can replace the word "myfirstproject" with any words of your choice. Rails will create all the file structure for you.
- Then type "cd myfirstproject" if you are not in the newly created directory. Then type "ruby script/server". This will boot up WEBrick web server. Btw, don't close this windows as it will shutdown your webserver.
- Type in http://127.0.0.1:3000. Tada! You have your Ruby application up and running. Well almost....
- There are additional steps, however you can refer to section IV of http://allaboutruby.wordpress.com/2006/01/09/installing-rails-on-windows-step-by-step-tutorial/.
5 comments:
Thanks for this guide!
I really needed a clear step-by-step guide in setting up my very 1st ROR installation in Vista.
You saved me! ^^
hi,
Thank you for the post. Where do i find the post-install.rb file, i do not seem to find it and i get rails is not a recognized command when trying to create a rails app.
Thank you
Thanks, it was SO easy!!
when i run ruby script I see the following error, Pls help:
"ruby: No such file or directory -- script "
I was seeking for ruby on rails company and set down up on your mail and i should state thanks for distributing such helpful information.
Post a Comment