Build a Ruby on Rails environment on Windows

Source: Internet
Author: User

Build a Ruby on Rails environment on Kokko's Windows Platform

Use Ruby on Rails in Windows XP

1. Install Ruby,

Ruby on in win environmentE-click installer package, which is

Http://www.ruby-lang.org/en/downloads,

After the installation, click "Install", click "Next", "I agree", and select the installation path (my installation directory is D: \ Ruby)

Next, finish the installation.

Run CMD and enter ruby-V. If the installation is successful, the system returns the version number.

(My output is: Ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32])

So far, Ruby installation is complete.

2. Install rails

Run "Gem install rails -- include-dependencies" in Windows cmd. If you want to see which packages are installed, enter "Gem install rails" to automatically download the program, then there is waiting. You can go to Google to get more information about the gem. I will not introduce it here.
You can use rails-V to view the version information.

So far, Ror has been installed.

3. Create an empty rails webpage framework

Run the following command line:

Rails cookbook

You can see that rails generates a complete cookbook project directory for you. (My directory is D: \ Ruby \ cookbook)

You can familiarize yourself with the directory structure first.

Go to your project directory under the command line

Run: Ruby script \ Server (this command runs the server command under script to start webrick server)

Webrick introduction:
Ruby already contains a variety of software by default, among which webrick HTTP server is one. This package is used as the default Document Server for rubygem. This is a very simple server written in pure Ruby. Interested friends can go to Google to get more content.

Open your browser and enter

Http: // 127.0.0.1: 3000

The initialization page is displayed.

Run Ruby on Rails using apache2.2 and mongrel in Windows

I. Environment
1) install Ruby and rails
Above, not here.
2) install Apache,
Go to www.apache.org to download the latest Apache version, and install Apache on the next page.
3) install mongrel

Run the command: Gem install mongrel-y
Run the gem install mongrel_service-y command to install mongrel. Run mongrel as a service to start mongrel_rails service: Install-N cookbook-c d: \ Ruby \ cookbook-P 3000-e production.
Parameter description:
-N indicates the service name,
-D indicates the directory of the rails application,
-P is the TCP port of the mongrel listener,
-E is to open the control panel edition in start mode for production mode | management tool | service, you can find that a service named "cookbook" is added, and you can manage the service through the control panel edition.
You can also start, close, and log out the service through the command line: Start: mongrel_rails service: Start-N cookbook close: mongrel_rails service: Stop-n cookbook logout: mongrel_rails service :: remove-N cookbook if you need to install multiple mongrel instances, you can: mongrel_rails service :: install-N [process name]-C [RUBY project path]-P 3000-e production 3. Configure Apache to open CONF/httpd under the Apache directory with an editing tool. conf. You need to cancel the comments of the following modules: loadmodule proxy_module modules/mod_proxy.soloadmodule proxy_balancer_module modules/mod_proxy_balancer.soloadmodule proxy_http_module modules/mod_proxy_http.so, you also need to cancel the comment of the following module: loadmodule deflate_module modules/mod_deflate.so and configure the HTTP Proxy-based load balancing as follows: proxyrequests off
# Mycluster defines each mongrel application server node in the Cluster
<Proxy balancer: // mycluster>
Balancermember http: // localhost: 3000
Balancermember http: // localhost: 3001
</Proxy>
<Virtualhost *: 80>
Servername 127.0.0.1
DocumentRoot D:/Ruby/cookbook/Public
Proxypass/images! # Specify that requests starting with the URL are not forwarded to the mongrel cluster, but are processed by Apache itself
Proxypass/stylesheets!
Proxypass/javascripts!
Proxypass/balancer: // mycluster/
Proxypassreverse/balancer: // mycluster/
Proxypreservehost on
</Virtualhost>
Restart Apache and open the browser to access 127.0.0.1. If the configuration is correct, the project initialization interface is displayed.

Use editplus to build a ruby programming environment

1. Enable editplus to support Ruby syntax

1. Download ruby-supported extension packages from the editplus official website.

Http://www.editplus.com/others.html

Ruby2.zip)

Ruby STX, ACP-jonghee Park

2. The downloaded package contains two files: the syntax file (STX) and the automatic completion file (ACP). These two files are placed in the editplus installation directory.

3. Open the tool-> Parameter Selection-> file (settings and syntax) in the menu, and add the ruby type.

4. Set the file extension, associate the downloaded syntax file with the automatically completed file.

2. Build a ruby runtime environment in editplus

1. Open tools> User tools> Add tools (programs) in the menu)

Set Menu text to Ruby.

Command (commend): C: \ Ruby \ bin \ ruby.exe(your ruby.exe path)

Parameter (argument): $ (filename)

Initial directory (initial directory): $ (filedir)

Select capture output

Of course, if you want to run it in the command line, do not select

Okay, write a ruby program, click ruby under the tool menu, or use a shortcut key. The result is displayed directly in the following window.

Refer:

Http://www.javaeye.com/blog/post/326091

Http://www.cnblogs.com/jessezhao/archive/2007/05/31/765766.html

Http://blog.othree.net/log/2006/11/02/ruby_on_rails_on_windows/

Http://www.onLamp.com/lpt/a/5546

Http://www.onLamp.com/pub/a/onLamp, 2005/01, 20, rails.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.