Build the RoR (RubyonRails) Environment on Ubuntu10.04

Source: Internet
Author: User
I have been developing RoR applications on Windows. Now, considering that the production environment needs to be converted to Linux, we need to build a Linux RoR environment on Ubuntu. For development and testing. 0. Build goals: Ruby1.8.7Rails2.3.8rubygem1.3.7mysql5.1 Description: I was planning to install Ruby1.9.2 and Rails3.0.0, but there was a problem with Rails3.0.0 in my environment.

I have been developing RoR applications on Windows. Now, considering that the production environment needs to be converted to Linux, we need to build a Linux RoR environment on Ubuntu. For development and testing.

0. Goal:
Ruby 1.8.7
Rails 2.3.8
Rubygem 1.3.7
For mysql 5.1
Note: I was planning to install Ruby 1.9.2 and Rails 3.0.0, but there was a problem with Rails 3.0.0 in my environment. Due to time constraints, I temporarily switched to Ruby and Rails versions earlier. (The installation of Ruby 1.9.2 and Rails 3.0.0 in Ubuntu 10.04 will be explained separately .)

1. Ubuntu machine environment
:~ $ Sudo lsb_release-
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS
Release: 10.04
Codename: lucid

2. Install Ruby 1.8.7.
Sudo apt-get install ruby-full
Run ruby-v verification after installation

3. Install rubygem
Download rubygems-1.3.7.tgz
Then unpack and run
Ruby setup. rb is installed on/usr/bin/gem1.8 by default.
Create a soft connection file
:/Usr/bin $ sudo ln-f-s./gem1.8./gem

4. Install Rails
Check available Rails versions
$ Sudo gem list -- remote -- all rails
Rails (3.0.0, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.4, 2.0.2, 2.0.1, 2.0.0, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.0, 0.14.4, 0.14.3, 0.14.2, 0.14.1, 0.13.1, 0.20., 0.12.1, 0.12.0, 0.11.1, 0.11.0, 0.10.1, 0.10.0, 0.9.5, 0.9.4.1, 0.9.4, 0.9.3, 0.9.2, 0.9.1, 0.9.0, 0.8.5, 0.8.0)

Select 2.3.8 to run
$ Sudo gem install rails -- version = 2.3.8
Use rails-v for verification after installation

5. Create an application example and test Rails
Go to your own development work directory, such as $ home/workshop/
Rails mytest
After generating some files, go to the mytest directory and run
Ruby script/server-p 5000

6. Example of using a browser to access the application
Http: // 127.0.0.1: 5000
If the webpage content is displayed normally, the installation is successful.

7. mysql 5.1
Use the new software package manager to install the mysql query and administrator package, which is as easy as Windows.
Mysql-uroot-p

8. If rails uses mysql, modify the database. yml file.

Note: In this environment, Ruby 1.9.2 can be successfully installed, but Rails 3.0 cannot support work. The specific reasons are also studied and elaborated.

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.