Ruby on Rails window7 Environment building

Source: Internet
Author: User
Tags ruby on rails

Looking for a lot of online, not all. Toss for a long time, here record:

One. Download the window version of ruby193, then next installs to the specified directory (the installation interface will have 3 selection boxes, I have all chosen here, there is no need to manually configure the path of Ruby).
After you've installed Ruby, write a ruby test file test, and it's all right, to the end of this ruby installation. (Ruby installed on the internet is basically correct, not much to say here)

Two. Installation of the Rails framework (this is more cumbersome)

Most of them need to download and install Devkit first.
1. Download DevKit Http://cloud.github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe (WINDOWX)
Download down and click Install to the specified directory here I install to the D:/devkit directory.
2. Run several commands:

D:\devkit>ruby dk.rb Init (command 1, below is the correct information for the output)
[INFO] found Rubyinstaller v1.9.3 at d:/ruby193

Initialization complete! Please review and modify the Auto-ge
' config.yml ' file to ensure it contains the root directories
Of the installed rubies you want enhanced by the DevKit.


D:\devkit>ruby dk.rb Install (command 2, below is the correct information for the output)
[INFO] Updating Convenience Notice gem override for ' C:/ruby1
[INFO] Installing ' d:/ruby193/lib/ruby/site_ruby/devkit.rb '


D:\devkit>gem Install rdiscount--platform=ruby (command 3, below is the correct information for the output)
Fetching:rdiscount-1.6.8.gem (100%)
Temporarily enhancing PATH to include DevKit ...
Building native extensions. This could take a while ...
Successfully installed rdiscount-1.6.8
1 Gem installed
Installing RI documentation for rdiscount-1.6.8 ...
Installing RDOC documentation for rdiscount-1.6.8 ...
Done!

Three. Installing Rails
Execute under Ruby's Bin directory command line: Gem install Rails--include-dependencies-v.

No problem check Rails version rails-v
I'm here on Rails 4.1.5.
New Rails Project
Create a new folder E:/testrails, as the project root path

Enter in the cmd window: Rails new e:/testrails--skip-bundle to create a new rails project.

(--skip-bundle skip Bundle installation First, because the Ruby source path in the country may not be accessible,
Open the E:/testrails gemfile and change the source ' https://rubygems.org ' of the first line of the file to source ' http://ruby.taobao.org '. Of course, if you can access that rubygems.org, you don't need to change it.)

Under normal circumstances, some new directories and files are created under the E:/testrails directory as the framework of the project.
Then go to e:/testrails Install bundle, execute command: Bundle Install (Install once OK)
To this one testrails rails project is even built.


Startup Project: Here's a note, if your rails version is above 3.0, the script folder will not be generated in the Rails project folder.
Just go to the rails project root and execute the Rails server command directly.
Close is on the start terminal Ctrl + C is OK.
Open the browser to access the Http://localhost:3000/, if it appears on the Internet that the success of the page is OK.

This article is from the "re-learn Java" blog, please be sure to keep this source http://3131854.blog.51cto.com/3121854/1546342

Ruby on Rails window7 Environment building

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.