Note: Tutorial targeted at n00bs and is for a purely developer environemnt not suitable for a production environment (can be used as one but not recommended).
Ruby on Rails or just Rails is a framework for building web applications and is quite famous among the developers, first of all for the use of the wonderful language Ruby and next Rails itself is a wonderful piece of software in itself. Ruby is so english like and has a smooth learning curve especially for those new to programming than those who are used to some other language. Ofcourse when you are used to some language every other language seems to be strange.
Install Guide:
First of all you need to Download a few packages
Ruby Windows Installer – http://rubyforge.org/frs/?group_id=167
MySQL – http://dev.mysql.com/downloads/mysql/5.0.html#win32
The next thing you need depends on weather you have internet access on your developer machine or not, incase you have internet access, just use the following commandafter you have installed Ruby
gem install rails –include-dependencies
Incase you have problem installing using this command because you are currently on the plane or in the desert waging war against terror or may be worse behind a restrictive corporate proxy server, you need to download the gem files and install them individually.
First of all download the latest Rails gem from
http://rubyforge.org/frs/?group_id=307
donwload the file with the .gem extension and then run this command
gem install gem-name-x.x.x –local
example – gem install rails-1.2.3 –local
The gem file should be in the path or else change to the directory where you put the file and then run the command else you are going to get gem file not found error
When you enter the above command it gives an error message saying rail-1.2.3 needs some-other-gem-1.x.x , these are called dependencies, you need these installed before you install rails, so you need to download these gem packages too, so search for the gem file missing at the rubyforge site
I have made a list of dependecnies for the latest version of rails – rails-1.2.3
http://rubyforge.org/projects/rake/
activesupport (= 1.4.2)
http://rubyforge.org/frs/?group_id=570&release_id=10359
activerecord (= 1.15.3)
http://rubyforge.org/frs/?group_id=182&release_id=10363
actionpack (= 1.13.3)
http://rubyforge.org/frs/?group_id=249&release_id=10360
actionmailer (= 1.3.3)
http://rubyforge.org/frs/?group_id=361&release_id=10365
actionwebservice (= 1.2.3)
http://rubyforge.org/frs/?group_id=567&release_id=10366
grab the latest release of gem files at these project pages and install them using the common command
gem install gemname-1.x.x –local
Once you get rails installed, you can be sure that is has succesfully installed along with all the dependencies. You might wonder, dont these things need a web server like Apache? The answer is yes and no, its actually not necessary but sure is an optio. Ruby has a build in web server WEBrick, which lets you get started and running with just one command, no install needed!
Now that you have a developer Rails environemnt setup, you can go whip a new rails application in minutes with this tutorial at IBM Developer Works
17 comments ↓
[...] How to install Ruby on Rails on a windows PC « Anything, but not Everything (tags: rails ruby) [...]
Hi
I tried to install the Ruby and Rails as given above here but i did not able to do it successfully.
So please guide me out on this ASAP
Thanx
Gururaj
hello Gururaj, be more specific, tell me what your problem was and at which stage you faced the problem
Hi.. first of all there is a small correction….
The parameter LOCAL is followed with 2 dashes not one..
The correct command is
gem install GEMNAME –-local
Then rest of the things as said above in the post
First download all the mentioned GEMS, and place them in a directory.. Go to COMMAND PROMPT.
START -> RUN -> CMD
Then go to the directory where you have placed the GEM files. by using the command CD DIRNAME
Then start using the commands in the order..
GEM INSTALL activesupport –LOCAL
GEM INSTALL activerecord –LOCAL
GEM INSTALL actionpack –LOCAL
GEM INSTALL actionwebservice –LOCAL
GEM INSTALL actionmailer –LOCAL
GEM INSTALL rails –LOCAL
OR else instead of individually giving the command, put them all in one line and issue the command as below.
GEM INSTALL activesupport actionpack activerecord actionwebservice actionmailer rails –LOCAL
Hope this should solve the problem
Hi
please told how to install ruby on windows xp.it’s to hard to install please help me sir please explain the concept step by step
“gem is not recognized as an internal or external command”
Ruby is installed. Gems are downloaded. Any ideas?
Hmark, you probably just need to include your ruby\bin in the classpath, check your environment variables
i can not use active_scaffolding please can u give me one proper explanation how to use active_scaffold ……..
thx……
This install takes hours on Win XP. Do you experience the same windows users? How about linux users?
[...] Or even worse February 23, 2010 – 9:54 Funny quote from a Ruby on Rails installation guide: [...]
This is ridiculous – every guide I found over the past few days, including this one for installing ruby on rails on Windows just does not work.
For whatever reason running the gem install rails command in the command promt does not work i.e. ‘gem’ is not recognised…….. So the alternative suggested above to install the gems manually by going to rubyforge is very unclear.
What are you supposed to search for to find these magical gems that will allow you to run Ruby on Rails on Windows 7?
If anyone can point me to a clear guide on how to install Ruby on Rails on Windows 7 or even better enabling it to work with IIS7 specifically I would be extremely grateful.
Thanks,
Mark
I am having the same problem, what do i have to do in order to have gem recognized
alright i found out how to fix
for windows 7 you have to add to path
Control Panel > System and Security > System > advanced system settings > environment variables > scroll down to path and click edit.
then go to the end and and give it path to the ruby command
must put semi colon first
ex: ‘;C:\Ruby187\bin’
then go to command prompt, then gem and ruby command should work from there…
I was having very similar issues. I was able to get it all to work together and have documented my steps here: http://andrewgertig.com/2010/09/install-ruby-on-rails-on-a-pc-done-rubyonrails/
Hello
Thank you very much – still a helpful guide >3 years old!!
Hi,
I am getting error while installing rake using gem install rake command.
The error says: While executing gem … (Zlib::GZipFile::Error) not in gzip format.
If you could guide me to resolve the above error to install all the steps successfully then it will be really helpful for me and it will be highly appreciated.
Thanks in advance,
Kunjan
I apperceive i am a small away topic, but i just funds to say i adulation the blueprint of the blog. i am new in the direction of blogegine platform, so
Leave a Comment