Ruby's initial experience to build a running environment

Source: Internet
Author: User
Tags command line

Learning a language, I think the most should first understand is how to build the operating environment of this language. If we know the language's running environment, we can find the IDE tools that match the previous development habits, and then take a look at the introductory examples to learn a language-related knowledge. At such times, a language should begin to get started. It is only a matter of time before the rest of the school can learn and practise. My ruby environment is based on a Linux environment. Not tried under Windows.

First, the operating environment

1. Install Ruby language Interpretation environment

Apt-get Install Ruby RDoc ri

After the installation is complete, you can check the installation results

Ruby-v

The Ruby version information that you are currently installing will be displayed.

2. Install Ruby Language Package management System (Package Management System) RubyGems

Download http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz

Enter rubygems-0.8.11 from command line after decompression

Execute the following command:

Ruby setup.rb
gem install rubygems-update

3. Install Rails Framework

sudo apt-get install Rails

At this point, Ruby's running environment is over.

Second, development environment

Development must choose an easy-to-use tool. There are a lot of tools to support ruby Development on the web, but I still want to use eclipse. So find out if there are eclipse plug-ins to support ruby development. It's really good, I found it. Ruby also has the development environment plug-in RDT based on Eclipse.

It is recommended that you install Plug-ins remotely through Eclipse update installation.

From Eclipse's menu Help->software updates->find and Install

Select ' Search for new features to install ' for installation.

There are two plugins that need to be installed:

1, RDT

Http://updatesite.rubypeople.org/release

2, Radrails

Http://radrails.sourceforge.net/update

The location of the Ruby interpreter needs to be set after the installation is complete.

Open the Preferences dialog box through the Eclipse menu Windows > Preferences, where Ruby is set in installed interpreters under the ruby title.

Name, and then point the "Location" text field to the Ruby version of the bin directory that you are using. My machine Ruby's Bin directory in/usr/bin/ruby

In this way, the ruby environment is complete. Build a ruby project in Eclipse, build a ruby file, and write the puts "OK" to see the Eclipse console output OK information.

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.