Install RubyOnRails on Ubuntu

Source: Internet
Author: User
After learning Ruby during this time, it is really easy to get started. Especially after RubyOnRails is installed, it is very convenient to build a website through RubyOnRails. Here, I will share with you the process of installing RubyOnRails on Ubuntu. The installation process is simple and error-free. If you are interested in Ruby, you can try installing it, the most effective way to learn a language is to quickly build an environment and start writing code. For the installation process, refer to the following tutorial. The author of this tutorial is Ub.

After learning Ruby during this time, it is really easy to get started. Especially after Ruby On Rails is installed, it is very convenient to build a website through Ruby On Rails. Here, I will share with you the process of installing Ruby On Rails On Ubuntu. The installation process is simple and error-free. If you are interested in Ruby, you can try installing it, the most effective way to learn a language is to quickly build an environment and start writing code.

For the installation process, refer to the following tutorial. The author of this tutorial is "Cheng guyun" of the Ubuntu community. I'm not sure if "Cheng guyun" is the real name. If yes, it is really a charming name.Http://www.linuxidc.com/Linux/2010-12/30380.htm 

Prepare the Ubuntu environment before installation. For details, see http://www.linuxidc.com/linux/2011-10/46327.htm.

The first step is to start Ubuntu. Run the following command to install related libraries. The installation process is generally normal.

$ Sudo apt-get install gcc g ++ build-essential libssl-dev libreadline5-dev zlib1g-dev linux-headers-generic

Next, download the Ruby1.9.2 source code. I followed the tutorial and used the following command to download the code successfully, but the download process was a little slow. Please be patient.

$ Wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p0.tar.gz

After downloading the Ruby source code, decompress, configure, and compile the code. The command is as follows:

$ Tar-xvzf ruby-1.9.2-p0.tar.gz

$ Cd ruby-1.9.2-p0/

$./Configure-prefix =/usr/local/ruby

$ Make & sudo make install

After compilation, You need to modify the/etc/environment file and add the Ruby path to the environment variable so that the Ruby command can be called directly.

The command to start editing etc/environment is as follows:

$ Sudo gedit/etc/environment

Because gedit is used, the graphic interface editing interface is displayed. Add the Ruby path to the environment variable and save/etc/environment, as shown below:

PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/local/ruby/bin"

After modifying the environment variable file, you must run the source command to make the modification take effect immediately. The command is as follows:

$ Source/etc/environment

To check whether the installation is successful, enter the following command for testing:

$ Ruby-v

After confirming that the installation is successful, run the following command to add command links. Currently, I am not sure what the purpose of creating these links is. According to the Ruby "convention is greater than configuration" principle, it should be an agreement.

$ Sudo ln-s/usr/local/ruby/bin/ruby/usr/local/bin/ruby

$ Sudo ln-s/usr/local/ruby/bin/gem/usr/bin/gem

The above is the installation of Ruby. You can first test the basic syntax of Ruby. The impatient personnel follow the subsequent steps to install Rails.

First, install some components using the gem command. The command is as follows:

$ Sudo gem install tzinfo builder memcache-client rack-test erubis mail text-format bundler thor i18n

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.