Topic: HOWTO: Set up Ruby on Rails in Windows

Here's a quick Howto on setting up Ruby on Rails for Windows.

1. Go to RubyForge and download the latest version of the Ruby one-click Installer for Windows. Install it by running the setup program. I recommend installing it to c:\ruby
2. Download and install RubyGems.
3. When Ruby and RubyGems have both been set up, run this in a terminal/command prompt window to install Ruby on Rails and all its dependencies:

gem install rails --include-dependencies

4. Create a folder to hold your rails Apps. I use c:\rails.
5. Create a test application by issuing this command in a terminal/command prompt:
rails testApp

6. You should then see a folder called testApp in c:\rails. Go into the testApp folder in a terminal/command prompt and type this:
ruby script/server

7. Open your browser and go to http://localhost:3000/.
8. Congratulations, you're on Rails!


If this all seems like too much for you, you can also use InstantRails, which has Ruby, Rails, Apache, and MySQL all in one package.

vinnie - rails forum admin

Re: HOWTO: Set up Ruby on Rails in Windows

thanks, installing now smile

hoping to learn some ROR, any tips?  i am thinking of getting agile developement with rails, anything else i would need?

Re: HOWTO: Set up Ruby on Rails in Windows

Agile Web Development is good (I'm actually in the middle of reading the 2nd edition myself). I also recommend the Ruby on Rails API documentation so you know how all of the built in objects work.

For any more questions, hit up the Beginning Rails forum smile

vinnie - rails forum admin

Re: HOWTO: Set up Ruby on Rails in Windows

Also, Robby Russell (of RobbyOnRails.com and Planet Argon) is writing a new book for O'Reilly that is highly anticipated called Programming Rails. smile

http://www.programmingrails.com/

Josh Catone helps run this place
Rails Forum - Rails Jobs

Re: HOWTO: Set up Ruby on Rails in Windows

Thanx ..no 1000 thanx for this great tutorial ...i used Ruby before for simple applications now it`s time for Rails ........
Instant Rails is too great and simple too .
i added some more RubyOnRails Resources at my blog
http://webtho.goomedic.com/misc/ruby-on … orials-01/
Hamza

Re: HOWTO: Set up Ruby on Rails in Windows

Note there's a new welcome to rails page that pops up.

Welcome Aboard
Your riding the rails!

www.movieheretic.com - Reviews, Box Office, Chat from downunder. Now with added RoR goodness, beginner stuff.

www.skinbydragonfly.com - Invision skins, graphics, i-Tab revolution.

Re: HOWTO: Set up Ruby on Rails in Windows

So I am wondering, is it possible to use Instant Rails for deployment/production?

I am reading in the "Agile Web Development with Rails"-book that using a Windows-server for deployment/production is not recommended, and that actually came as a surprise for me, as I have always thought about using Windows for the server.

Do I really have to use Mac OS X instead? Or is it possible to use Instant Rails to set up my production server on Windows?

When reading chapter 27 in the "Agile..."-book I got a little frustrated, as it seems to be so much work to get an production server up and running. I have used Windows for development, and the setup was really easy, isn't there any solutions to make it almost as easy on a production-server?

I would really appreciate some input on this subject! Thanks in advance!

Re: HOWTO: Set up Ruby on Rails in Windows

This is too Helpful for a layman person who want to initially use Ruby on Rails. I find it too neat and simple. so many many thanks VINNIE.. I need one more favour from you.. Actually I had already running Apache 2.0.58 with PHP 5.1.6, MySQL 5.0.27, ASP.Net 1.1, Perl 5.8, Python 2.5.1 on my production windows 2003 server. Now I want to use Ruby on Rails with this setup. so could you please help me to install Ruby on Rails manually on this installed server? I appreciate if you pleased help me.

--Adonis Diesel

Re: HOWTO: Set up Ruby on Rails in Windows

Hi Vin

Great recipe for setting up ror on Win.

But, from what I can tell, its not that easy setting up a Win server for production... Do you have any tips or know of any sites that describes what to do to set up a Windows 2000/2003 production server with Ruby on Rails?

I am getting all frustrated because I can't find any information about this online, neither in any books. Everybody is talking about Linux or Mac OS X, nobody is saying anything about using Windows also after you are done developing. I have developed an ROR app on Windows, and I would also like to use Windows on my webserver when putting this app into the real life.

I really hope you have some input on this, thanks in advance!

Re: HOWTO: Set up Ruby on Rails in Windows

Hans_Oslo: The reason for that is that most Rails devs wouldn't use a Windows server. But to answer your question, I see no reason you couldn't use a similar production environment to a Unix box: a cluster of Mongrels behind a balancing proxy (such as Apache 2.2's mod_proxy_balancer).

Re: HOWTO: Set up Ruby on Rails in Windows

Setting up a production Rails Server on Windows is explained here

http://nlakkakula.wordpress.com/2008/11 … l-cluster/

Re: HOWTO: Set up Ruby on Rails in Windows

vin wrote:

Here's a quick Howto on setting up Ruby on Rails for Windows.

2. Download and install RubyGems.

3. When Ruby and RubyGems have both been set up, run this in a terminal/command prompt window to install Ruby on Rails and all its dependencies:

Code : 
gem install rails --include-dependencies

When i try this code, the output will be:-

C:\rails>gem install rails --remote
'gem' is not recognized as an internal or external command,
operable program or batch file.

The same happen when i try thr rails testApp...
What is actually wrong here?

Im sorry to ask this silly question...Because Im so new to this....
but where to put this gem file?

Last edited by komeng (2009-05-11 16:50:06)

13

Re: HOWTO: Set up Ruby on Rails in Windows

I had a similar problem as Komeng and solved it by resetting the command prompt console

Re: HOWTO: Set up Ruby on Rails in Windows

thanks vin.. im following your step by step guide,also downloading the links you gave.. hoping it will work fine with me.. thanks a lot again..

15

Re: HOWTO: Set up Ruby on Rails in Windows

After so much aggravation I decided to install Ubuntu 9.10 on an old pc and installed rails on it.
The installation is done automatically with only a few strokes using the command console.

I know this is a Windows thread, but Ubuntu might be a way to go for many people.
The other advantage I found is that it is now more practical to read this forum or any other online guide, using my Windows PC and follow through on my other Ubuntu machine by my side.

Most instructions out there are based on older rails. There is a great article about it that shows how to install rails and teachs the differences between old rails and the new version 2. After following their instructions this weekend I now understand the concept of rails.
This is the link:
Rails 2.0 and Scaffolding Step by Step

Re: HOWTO: Set up Ruby on Rails in Windows

Deploying Ruby On Rails is Easy..

Passenger aka mod_rails
2. Proxy setups
3. JRuby on Rails
4. Automate with Capistrano
5. Hosting

read more: http://www.rordevelopers.com & http://rubyonrails.org/deploy

Re: HOWTO: Set up Ruby on Rails in Windows

I've had great success setting up RoR in my Windows 7 environment by following the tutorial at http://chakwong.com/?p=12 this URL doesn't work...

Hope that helps. Take care!

Re: HOWTO: Set up Ruby on Rails in Windows

If your Windows box is behind a proxy, you will need to set the http-proxy environment variable:

SET HTTP_PROXY=http://{username}:{password}@{proxy-server-name}

Re: HOWTO: Set up Ruby on Rails in Windows

vin wrote:

Here's a quick Howto on setting up Ruby on Rails for Windows.

5. Create a test application by issuing this command in a terminal/command prompt:

rails testApp

I needed:

rails new testApp

Re: HOWTO: Set up Ruby on Rails in Windows

vin wrote:

Here's a quick Howto on setting up Ruby on Rails for Windows.

6. You should then see a folder called testApp in c:\rails. Go into the testApp folder in a terminal/command prompt and type this:

ruby script/server

Just noticed how old the original article is!

I needed:

rails server

And also needed to download the sqlite3 DLL from the SQLite site download page (http://www.sqlite.org/download.html).  (Placed it in the Ruby bin folder - anywhere quoted in PATH is OK.)

Up and running now though!

Last edited by Magnesium2431 (2010-09-21 03:38:06)