Download and install Ruby on Rails and build the development environment

Source: Internet
Author: User
Tags ruby on rails
The download and installation of Ruby on Rails and the establishment of development environments should be based on Ruby to develop applications. Program You must install Ruby, Gem, rails, and mongrel.
First, download the latest Ruby one-click installer version on the official website (a ruby standard package manager already comes with rubygems), which is. Http://www.ruby-lang.org/zh_cn/downloads/

Second, install Ruby, double-click it, and then click Next... to complete the installation, which will be installed in the C:/Ruby directory by default.
Open the command line again and enter ruby-V to query the ruby version.

third, download rails, this article downloads rails2.0.2 (the downloaded file name is: rails-2.0.2.zip), is: http://rubyforge.org/frs/download.php/29361/rails-2.0.2.zip
installing install rails -- include-dependencies (I encountered a version error during installation, such as network stability or use this command ), This installation method requires network connection and installation often fails. Instead, download a stand-alone packages version and install it locally. Copy the file rails-2.0.2.zip to the rubyinstallation directory and rename rails-2.0.2.zip to rails.zip. Otherwise, go to the Internet to find it during installation.
run the gem install rails command in the command line to complete the installation in seconds. Note: The compressed files do not need to be decompressed. Of course, you can also decompress the files. It is not a problem to go To the plug-in directories and install them one by one.
install rails in sequence:
1, activesupport
2, activerecord
3, actionpack
4, actionmailer
5, actionwebservice, rails
these gemfiles can all be found in the vendor/rails file in the rails.zip package.
after installation, enter the following command line: rails-V to view the rails version.

Fifth, download mongrel, the latest version is: 1.1.4, for: http://rubyforge.org/frs/download.php/33195/mongrel-1.1.4-x86-mswin32-60.gem
To install mogrel, you also need to download the gem plugin, daemons, fastthread, cgi_multipart_eof_fix, which is
Gen_plugin: http://rubyforge.org/frs/download.php/27044/gem_plugin-0.2.3.gem
Daemons: http://rubyforge.org/frs/download.php/34222/daemons-1.0.10.gem
Fastthread: http://rubyforge.org/frs/download.php/29508/fastthread-1.0.1-i386-mswin32.gem
Cgi_multipart_eof_fix: http://rubyforge.org/frs/download.php/27040/cgi_multipart_eof_fix-2.5.0.gem

Sixth, install mongrel.
Gem install gem_plugin-0.2.3.gem
Gem install daemons-1.0.10.gem
Gem install fastthread-1.0.1-i386-mswin32.gem
Gem install cgi_multipart_eof_fix-2.5.0.gem
Gem install mongrel-1.1.4-x86-mswin32-60.gem latest version 1.1.5You can also use this command: Gem install mongrel-include-dependenciesGem install mongrel_service-y

7. Create a rails application for testing.
Enter the directory where you want to create the project. If the project name is "hello", run "Rails hello" in the command line to generate a "hello" folder under the installation directory. My directory is D: \ Ruby \ hello
At this point, the system will automatically create Ruby on Rails Applications, automatically initialize the directory structure and some basic stuff.

Eighth, start rails
Enter the hello directory and enter mongrel_rails start-D in the command line to start the mongrel server.
The default server occupies port 3000. Finally, open IE and test whether the main interface of Ruby on Rails can be displayed.
At this point, Ruby on Rails is successfully installed.
Command: mongrel_rails service: Install-N myapp_hello-c d: \ Ruby \ hello-P 3000-e production-N indicates the service name, and-D indicates the rails application directory, -P indicates the mongrel listening port, and-e indicates that the start mode is the production mode. In this way, a service myapp_hello is added to Windows Services. Of course, you can also download some integrated development environments, which can be omitted in a lot of work. However, if you use the most common command line mode, you may be able to experience more. Although there is a lot of sweat in the middle and how many brain cells are murdered, you are happy! Haha

Last, if you install instantrails directly, it is http://rubyforge.org/frs/download.php/29867/instantrails-2.0-win.zip. You don't need to do anything, Because Ruby, rails, mongrel, and Apache are all packaged together. However, to understand the entire installation process, we recommend that you install it one by one. It is recommended that you do it several times at the beginning!

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.