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.