Ruby(1)----Get Started

作者: 我在等待
发布时间:2015-07-13 11:31:42

    If you have already been familiar with Java, C++ or other OO languages, these articles will let you be a Ruby developer ASAP. I won't explain any OO concepts here.
     
1.0 Set up develop environment (Windows)
      1. Download Instant Rails ( here uses version 1.5) and install it to %RAIL_PATH%.
     
1.1 First Example
     1. Start a Command Window, and change to %RAIL_PATH%, run use_ruby.cmd.
     2. Create a ruby file hello.rb, paste the following code.

    puts sayHello("Ruby")     # Write to the console
         
    def sayHello(name)
      result = "Hello, " + name
      return result
    end

     3. run ruby hello.rb, see what you get.

标签: Ruby
来源:http://www.cnblogs.com/abccd/articles/667083.html

推荐: