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).