Ruby Installation Run

Source: Internet
Author: User

A brief introduction to Ruby Foundation 1. Ruby installation under Windows Platform (1): http://rubyinstaller.org/downloads/(2) installation process Here we choose the installation path to D:\Ruby. The following 3 options are: (1) Whether TCLTK support is installed. (2) Add the Ruby command path to the system environment variable path. (3) whether the. RB and. rbw files are associated with Ruby. Here we all tick. Click "Install" to complete the installation. (3) View native installed Ruby version open cmd Command window, enter ruby-v to view native Ruby version 2. Write the first Ruby code to run the Ruby program in three ways: (1) Use the ruby command interactively: Enter the ruby carriage return in cmd and enter the puts " Hello,world ", to Ctrl+d, the last enter key to end can see the result of IB mode: Enter Irb,enter in cmd and enter puts" Hello,world "again enter (2) Write program file Create Demo.rb:puts "Hello,world" def Hello (name)     puts "Hello #{name}" Endhello ("Mac") Open cmd, View Demo.rb's property, enter its location in cmd, and execute  3. Installing Rubygemsrubygems is a handy and powerful Ruby package manager, similar to the Redhat rpm. It packs a ruby application into a gem as an installation unit. Features: Can remotely install packages, the management of dependencies between packages, simple and reliable unloading, query mechanism, can query the local and remote server package information, can maintain a package of different versions, web-based viewing interface, can view the information you installed gem. The newer version of Ruby already contains rubygems, so we don't have to download the installation manually. Just enter the command in the CMD window: Gem update--system, wait patiently for a while, the existing rubygems will be updated to the current version. 4. Install rails from the cmd prompt window to enter instructions: Gem install rails starts to install rails. If you do not want to install the documentation file, you can enter: The Gem install Rails--no-rdoc--no-ri program automatically downloads and installs rails, waiting patiently. In the cmd prompt window, enter the command: rails-v  displays the version number of rails. 5. Download and install DevkItdevkit is a tool for compiling and using the local C + + expansion pack under the Windows platform. It is used to simulate the make, GCC, sh to compile on the Linux platform. This method currently supports only Ruby that is installed through Rubyinstaller. Download Devkit:http://rubyinstaller.org/downloads Installation steps: 1) unzip the download DevKit to the D:\DevKit directory. 2) Open the CMD window, enter the D:\DevKit directory, and enter the Ruby DK.RB init. #生成config. Yml, this examines the list of Ruby that will be added Devkit support, only Ruby that is installed through Rubyinstaller. 3) Enter the ruby dk.rb install  #开始安装. 4) input Ruby dk.rb review  #检查要添加DevKit支持的Ruby列表是否有误, can skip. 5) Enter the gem install Rdiscount--platform=ruby. #这一步只是验证DevKit是否安装成功, if you can install the Rdiscount successfully stating that the installation Devkit successful, you can not do it. The whole process 6. Install scite:http://www.scintilla.org/,windows under the SciTE is not provided by the installation program, just need to double click on the inside of the file, Add. rb files, click tools- >go, run   Two project problems encountered 1. Two specific issues encountered in the project 1. The gems used in the project are as follows: Require ' rubygems ' require ' jira ' require ' IRB ' run times wrong: cannot Load such file jira<loaderror> solution: Gem install Jira error again: Cannot load such file--ffi_c<loaderror> solution: Gem Install FFI--platform=ruby

Ruby Installation runs

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.