win764-bit Ruby2.0 environment built in Ruby on Rails

Source: Internet
Author: User
Tags ruby on rails



One: Install Ruby

1, in http://rubyinstaller.org download needs the Ruby version, because is EXE file, so, you can install directly.



After the installation is complete, CMD runs on ruby-v to display the version number. If the ruby version number is displayed correctly, the installation is successful.






After Ruby is installed, run gem-v with the cmd command to verify that the RubyGems installation was successful.



  

2, download the Devkit file, then unzip the installation, choose the directory you want. (The order of this step is very important, otherwise the 4th step may be wrong)



Gems are often encountered when installing or upgrading under Windows


Please update your PATH to include build tools or download the DevKit from ‘http://rubyinstaller.org/downloads‘ 
and follow the instructions at ‘http://github.com/oneclick/rubyinstaller/wiki/Development-Kit‘


That's because there's no devkit installed.
Go to URL http://rubyinstaller.org/downloads download the corresponding version of Devkit
After the download is complete, execute this file and customize the Extract directory Devkit to enter this directory.
  


3, cmd into the Windows command operation, enter the Devkit folder, do the following:



CMD Run command line > CD DEVKIT


> Ruby DK.RB Review  
> Ruby dk.rb Install [INFO] Updating convenience Notice gem override for ' c:/ruby192 '
[info] installing ' c:/ruby192/lib /ruby/site_ruby/devkit.rb '

Two: Install Rails



1. Using Remote Installation Rails
cmd into Windows command operation, Geminstall rails--include-dependencies or gem install rails--remote



2. Use local rails installation
rails:http://rubyforge.org/frs/?group_id=307
Rails activesupport:http://rubyforge.org/frs/?group_id=570
Rails activerecord:http://rubyforge.org/frs/?group_id=182
Rails actionpack:http://rubyforge.org/frs/?group_id=249
Rails actionmailer:http://rubyforge.org/frs/?group_id=361
Rails actionwebservice:http://rubyforge.org/frs/?group_id=567
Rails rack:http://rubyforge.org/frs/?group_id=3113



Note: After installation, look through the rails-v to see if the installation was successful.






According to Online Ruby's predecessor, the middle of this line of DL is deprecated, the use of fiddle is a warning that can be ignored.



The version number of rails is shown below



Three: Create a web App



1. Enter Rails new Testweb,testweb under the command line as the project name. The location of the project is the directory path of the current command.



2. Under current directory (TestWeb), run Ruby Script/server to start the service.



3, the browser input http://localhost:3000/, if you see the following page, instructions OK.






In particular, it is noted that the following error may occur if the Devkit is not installed.

Error:error Installing Gherkin:
The ' JSON ' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
From ' Http://rubyinstaller.org/downloads ' and follow the instructions
At ' Http://github.com/oneclick/rubyinstaller/wiki/Development-Kit '

The root cause is the lack of a devkit library, the solution is as follows, refer to one (2).


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.