I am finding the installation process for Rails a bit confusing. First of all I want to use: Windows 2000 Apache 1.3+ MySQL The above is accomplished with WAMP5 from wampserver.com The problem is that there is no complete step-by-step for installation in this enviroment. The wiki instructions hop around from One-click to Apache.conf and other items. Installing CGI support for languages on Apache under windows is not that hard as long as you get the right components and install them in the right order. The wiki does not give you any of this and finding and gathering information from other sources is just as difficult (the fastCGI site is terrible). Especially the part where the installation of Rails is left over to Ruby Gems and installing Ruby Gems is left to one-click installer. Part of the reason PHP is so popular is that setting up a dev machine is simple. Even a manual installation takes only a few minutes following the steps provided in the docs. Can the installation of Rails be made as good or better? Tesla
Tesla wrote:> I am finding the installation process for Rails a bit confusing. First > of all I want to use: > > Windows 2000 > Apache 1.3+ > MySQL > > The above is accomplished with WAMP5 from wampserver.com > > The problem is that there is no complete step-by-step for installation > in this enviroment. The wiki instructions hop around from One-click to > Apache.conf and other items. Installing CGI support for languages on > Apache under windows is not that hard as long as you get the right > components and install them in the right order. The wiki does not give > you any of this and finding and gathering information from other sources > is just as difficult (the fastCGI site is terrible). Especially the part > where the installation of Rails is left over to Ruby Gems and installing > Ruby Gems is left to one-click installer. > > Part of the reason PHP is so popular is that setting up a dev machine is > simple. Even a manual installation takes only a few minutes following > the steps provided in the docs. Can the installation of Rails be made as > good or better? > > TeslaOkay, Let''s take the windows installation text and try and fill in the gaps Howto Install On Windows I’ve finally made it work for me on a laptop, so I thought I’d share. These instructions are probably pretty generic across different Window PC’s. If this works for any other Windows versions, Processor types, etc., please list them here: * Windows XP SP2 - Intel Celeron 2.80 GHz * Windows XP SP1 - Pentium 4 3 GHz Things you’ll need Here: A webserver is needed the prefered webserver is Apache. But is Apache 2 a requirement or can Apache 1.3 be used. Forget the fact that Apache2 is more stable in windows. Since this is a development server the end result should be a server that is as close to the web hosting server as possible. This means using Apache 1.3+ since most web hosting is on Apache 1.3. Apache2Triad Wamp5 UniformServer Apache 2+ Apache 1.3+ Ruby one-click installer Manual installation Here it should be stated that the one-click installer gives everything that is needed. But something that is missing is the fact that Apache runs CGI through a mod and can be set up and configured manually. Mods like mod_ruby,modpython require placement and configuration in the http.conf. Initial intallation Do your normal install of the basics: This section does not have a link or an explaination of a "basic installation". 1. Install Apache2Triad 2. Install Ruby one-click installer Setup/Configuration Here is where the fun begins: Here: suddenly things go back to a manual istallation format. This is necessary because of the nature of the Apache webserver. It needs to have http.conf done manually. But it is confusing in that the steps are mixed into the same paragraph without headers. open CMD (Start > Run > type in: cmd) then find your installation of ruby C:\webserver\ruby\bin> gem update C:\webserver\ruby\bin> gem install rails --include-dependencies These commands may take a long time, just be patient. C:\webserver\ruby\bin> rails C:/apache2triad/htdocs/appname And the last step is this: Find Apache conf file: C:/apache2triad/conf/httpd.conf all the way at the end of file (so it is easy to find later on) place this follow code: ################################# # RUBY SETUP ################################# Listen 8889 <VirtualHost *:8889> ServerName appname DocumentRoot "C:/apache2triad/htdocs/appname/public" ErrorLog "C:/apache2triad/logs/apache.log" <Directory "C:/apache2triad/htdocs/appname/public"> Options ExecCGI FollowSymLinks AddHandler cgi-script .cgi AllowOverride all Order allow,deny Allow from all </Directory> </VirtualHost> ################################# # RUBY SETUP ################################# Where all the fun points to: http://localhost:8889 The use of [variable]is standard in documentation and should be used here also. Not everyone will understand that the port number is variable according to the installers preferences. Have fun and good luck!! Tesla
Larry Kelly
2005-Aug-16 13:19 UTC
Re: Re: Needed - a step by step WAMP installation of Rails
Thanks for documenting this. I may need this if I cannot resolve my Windows 2003 IIS delay issue. I have two quick questions: 1. Do you experience a longe delay ( > 20 seconds ) when accessing your rails website? 2. How would you configure Apache for fastcgi? -L <snip> -- Best Regards, -Larry "Work, work, work...there is no satisfactory alternative." --- E.Taft Benson _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Larry Kelly wrote:> Thanks for documenting this. I may need this if I cannot resolve my > Windows 2003 IIS delay issue. I have two quick questions: > > 1. Do you experience a longe delay ( > 20 seconds ) when accessing > your rails website? > > 2. How would you configure Apache for fastcgi? > -L > > <snip> > > -- > Best Regards, > -Larry > "Work, work, work...there is no satisfactory alternative." > --- E.Taft Benson > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/railsLarry, I am trying to consolidate the two installation tutorials I have found on the wiki. One is with FastCGI but jumps over mod_ruby. The other does not mention either. I will post more on this as I test and update the instructions. The biggest road block to it all is the lack of requirements for usage of Rails. This information should actually come from a core developer. Perhaps it is in the new book. Tesla
Sascha Ebach
2005-Aug-16 15:01 UTC
Re: Re: Needed - a step by step WAMP installation of Rails
Tesla wrote:> The biggest road block to it all is the lack of requirements for usage > of Rails. This information should actually come from a core developer. > Perhaps it is in the new book.No core developer uses Rails on Windows. It is simply not a recommended production platform. Also try asking in the IRC channel. Maybe you are lucky ... Sascha
Sascha Ebach wrote:> Tesla wrote: > >> The biggest road block to it all is the lack of requirements for usage >> of Rails. This information should actually come from a core developer. >> Perhaps it is in the new book. > > > No core developer uses Rails on Windows. It is simply not a recommended > production platform. Also try asking in the IRC channel. Maybe you are > lucky ... > > SaschaThe channel has too much noise. I will go to the ruby list. Tesla
Dave Silvester
2005-Aug-16 15:57 UTC
Re: Re: Needed - a step by step WAMP installation of Rails
Tesla wrote:> The channel has too much noise. I will go to the ruby list.Don''t write it off just yet - I''ve had some immensely helpful answers from people in there! You''ve just got to ask the right questions and be patient. If you aren''t familiar with it already, the following is a highly recommended read in the art of asking the right questions online: http://www.catb.org/~esr/faqs/smart-questions.html Cheers, ~Dave -- Dave Silvester Rent-A-Monkey Website Development Web: http://www.rentamonkey.com/
Tesla wrote:> I am finding the installation process for Rails a bit confusing. First > of all I want to use: > > Windows 2000 > Apache 1.3+ > MySQL > > The above is accomplished with WAMP5 from wampserver.com > > The problem is that there is no complete step-by-step for installation > in this enviroment. The wiki instructions hop around from One-click to > Apache.conf and other items. Installing CGI support for languages on > Apache under windows is not that hard as long as you get the right > components and install them in the right order. The wiki does not give > you any of this and finding and gathering information from other sources > is just as difficult (the fastCGI site is terrible). Especially the part > where the installation of Rails is left over to Ruby Gems and installing > Ruby Gems is left to one-click installer. > > Part of the reason PHP is so popular is that setting up a dev machine is > simple. Even a manual installation takes only a few minutes following > the steps provided in the docs. Can the installation of Rails be made as > good or better? > > TeslaThis is what I have so far. Anyone have anything to add before I do some testing and change the wiki entry? Requirements Apache Webserver This instructional is based on the use of windows as a development environment for Apache2 and Ruby on Rails. So it is assumed the webserver of choice is Apache2 of one version or another. You may install Apache2 on windows or you may use any of the following Apache2 install packages. Apache2Triad Wamp5 Xampp Uniform Web server Database server In most cases the above webserver packages include one or several opensource database servers. It is just a matter of choosing one that applies to you situation. In cases where the database server is not a typical one, refer to that softwares documentation for instructions on installation to windows. Ruby progamming environment Ruby one-click installer - A self-contained installer that includes the Ruby language, dozens of popular extensions, a syntax-highlighting editor and the book "Programming Ruby: The Pragmatic Programmer''s Guide". Platforms: Windows NT/2000/XP, (OS X in development). Optional server software FastCGI and other software may be necessary in order to emulate a production server as closely as possible. Installing the Apache2 webserver Install the Apache2 webserver according to the instructions in your choice of webserver package. In most cases this is just a single click on the installer icon and setting the paths to where you want things. Using FastCGI The use of Fast CGI to deliver Rails applications can increase speed through in-memory caching. Place the fast CGI dll in a folder used for Apache modules in your webserver installation (check the software docs) and configure httpd.conf by adding this line to the module section: LoadModule fastcgi_module [path to the dll file]mod_fastcgi-2.4.2-AP20.dll Here''s an example of what you should see in your httpd.conf file. LoadModule php5_module "i:/wamp/php/php5apache.dll" LoadModule fastcgi_module "i:/wamp/fastcgi/mod_fastcgi-2.4.2-AP20.dll Using mod_ruby This is not recommended when using Rails. Rails is independant and does not need mod_ruby to run.Mod_ruby is an alternative way of using Ruby to create web applications. You can use mod_ruby as CGI and have web pages containing Ruby code interpreted natively by Apache2. Mod_ruby does not have the set MVC that Rails uses and many other tools that make quick work of creating a web application. It might be best if you decide to use mod_ruby to stop at this point and not install rubyonrails. This is because we are trying to get a development server going that is similar to a web hosting enviroment and not many web hosts are going to use both mod_ruby and rubyonrails. There is also the fact that a *.dll for windows use of mod_ruby to this date does not exist. Mod_ruby installation would include compiling under windows using cygwin and other tools. This probably accounts for a good portion of the popularity of RubyOnRails. Ruby for Apache RubyforApache is an installer package for fastCGI and mod_ruby which takes the place of doing a manual installation of each module. This package use Linux *.so (shared object) files and is compatible with Apache2 only. Despite the name which does not take into account Apache 1.3+ is still the defacto webserver on Linux web hosting. Again take warning that if you install mod_ruby you should not use RubyOnRails. Setting up Ruby, Ruby Gems and Rails Here is where the fun begins: Run the "Ruby one-click installer":http://rubyforge.org/projects/rubyinstaller/ and follow the instructions accordingly. open CMD (Start > Run > type in: cmd) then find your installation of ruby C:webserverrubybin> gem update C:webserverrubybin> gem install rails --include-dependencies These commands may take a long time, just be patient. C:webserverrubybin> rails C:/apache2triad/htdocs/appname Configuring the Apache2 webserver Find Apache2 conf file. In most cases the webserver package has set a link in the program listings of windows or a shortcut on your destop. But you can also find the file by surfing the file system for a path like this example: C:/apache2triad/conf/httpd.conf. All the way at the end of file (so it is easy to find later on) place this follow code: ################################# # RUBY SETUP ################################# Listen [port number] ServerName appname DocumentRoot "C:/apache2triad/htdocs/appname/public" ErrorLog "C:/apache2triad/logs/apache.log" Options ExecCGI FollowSymLinks AddHandler cgi-script .cgi AllowOverride all Order allow,deny Allow from all ################################# # RUBY SETUP ################################# Where all the fun points to: "http://localhost:[port number]":http://localhost:[port number] Have fun and good luck!! Watch these lessons : Rails for Windows, lesson 1 - Simple setup under win32 [some may need to replace “ruby script\new_controller Hello index” in this lesson by “ruby script\generate controller Hello index” for it to work] – Hope this helps.]—Also for win32, “public/ruby dispatch.servlet—a” is now called from the app root as “ruby script/server” Rails for Windows, lesson 2 - XAMPP install, db usage Rails for Windows, lesson 3 - Apache setup Rails for Windows, lesson 4 - IRB Rails for Windows, lesson 5 - Logging Recommended tools: Ruby for Windows I recommend the latest stable version. People in irc report that 1.8.2 pre versions seem to work, though. Ruby gems You will need gems to install rails. The latest stable version(s) of Ruby for Windows include rubygems. Ruby For Apache One-click installer of mod_fastcgi and mod_ruby. Scite A very good win32 text editor (comes with the Ruby for Windows installer) More on Scite.
Steve Downey
2005-Aug-16 19:13 UTC
Re: Re: Needed - a step by step WAMP installation of Rails
Tesla, Your efforts are appreciated. Please keep at it. Steve
Ronny Hanssen
2005-Aug-17 05:29 UTC
Re: Needed - a step by step WAMP installation of Rails
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Good to see someone clean this up somewhat. I have dropped using apache on my dev machine, and resided to only use WEBrick, which has simplified the installation quite a bit. And the one-click-installer really does help. Also being able to set up rails via one command is also not too difficult. I have set up my production server on Linux, using apache2 and fastcgi, and I had some struggles with fastcgi before I got to run properly. The tip here is to be sure to set the rights properly for the fastcgi temp area (as far as I can remember the wiki settings weren''t good enough in my case). BTW: Talking about LAMP... I''d like to introduce another acronym for development environments. In my dreams the Windows development setup should be the "WARP" environment: Windows - Apache - Ruby - Postgres. This is a fully open-sourced and free setup. (Except for the Windows license part though..) I used to do MySQL+PHP work, and I am now moving into Postgres+Ruby/Rails. So WARP seems natural to me :) That is - on Linux that''d be: LARP. Hmmm, sounds better for Windows ;) - ------------------------------------------------------------------------ /*Ronny Hanssen*/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDAsslMRRzQX3ma+kRAsIIAJ9UJcFYhw9onVDKyAPBSvO00+9odgCghKIn WNA48g/qfLP0PFrWMzFlqOo=tIVx -----END PGP SIGNATURE-----