Ruby is the first step on the road to

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

 

See more and more people begin to learn Ruby and Rails on the Internet, going to try it. Here the preparation and the development environment to build my record.

 

The first is Linux system installation, because the web does not recommend the use of Windows to play Ruby, so I choose to install Ubuntu and get a double system in my Win7, I chose the Ubuntu 12.04 version of LTS.

 

See concrete.

 

After the double system boot up, into the Ubuntu system, start the installation of Ruby and Rails development environment.

 

1 first install rbenv. Rbenv is a Ruby version management software, it can be used to install and manage multiple versions of a simple Ruby.

 

Sudo apt-get install git libssl-dev (GIT tools and the necessary packages)

 

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv (rbenv)

 

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc (rbenv)

 

echo 'eval "$(rbenv init -)"' >> ~/.bashrc (rbenv)

 

git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/Ruby-build (download the ruby-build plug-in)

 

Use rbenv to install Ruby 2.

 

Rbenv install 2.0.0-p247 (Ruby installed)

 

Rbenv global 2.0.0-p247 (the default version)

 

Use gem to install Rails 3.

 

Gem sources --remove (remove foreign gem source)

 

Gem sources -a (add home gem source)

 

Gem install rails (Rails installed)

 

4 Ruby and Rails development environment after the success of the installation, choose to install a development tool, I chose the Sublime Text 2. To download on their website,. Sublime Text 2 configuration can be see.

 

The first 5 of the Ruby program

 

Open the Sublime Text 2, create a new hello.rb file, save in the main directory, as follows:

 

puts "Hello World!!!"

 

Open a terminal, use the ruby hello.rb to run the program.

 

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Connie at February 01, 2014 - 4:07 PM