Rubyyonrails installation on Ubuntu12.04

Source: Internet
Author: User
The installation environment on rails on Ubuntu has been installed many times, and many problems are encountered each time. This time, the installation steps on Ubuntu12.04 are recorded, saving the trouble of installation later. first, install g ++ ubuntu without installing this, which is installed to compile and install the software apt-getinstallg ++ 2. install rvmbash & lt; (curl-shttps: // rvm.beginrescueend.com/I

The installation environment on rails on Ubuntu has been installed many times, and many problems are encountered each time. This time, the installation steps on Ubuntu 12.04 are recorded, saving the trouble of installation later.

1. First, install g ++ ubuntu without installation.

Apt-get install g ++

2. Install rvm

Bash <(curl-s https://rvm.beginrescueend.com/install/rvm)

Configure the file. bashrc in the root directory of the user.

Add one sentence at the end

[[-S "$ HOME/. rvm/scripts/rvm"] &. "$ HOME/. rvm/scripts/rvm"

Run the following command to make the configuration take effect.

Source. bashrc

3. Install RUBY

Https://rvm.io/rvm/install/

There are commands to install

4. Install rails

If you use gem intsll rails directly, an error may occur.

ERROR: Loading command: install (LoadError)

Cannot load such file -- zlib

ERROR: While executing gem... (NameError)

Uninitialized constant Gem: Commands: InstallCommand

This should first download the installation zlib1g-dev

Sudo apt-get install zlib1g-dev

Then re-compile zlib In the ruby source code.

Take my installation directory as an example. Go to the following path and adjust the path based on the installed ruyb version.

~ /. Rvm/src/ruby-1.9.3-p194/ext/zlib

Run commands

# Ruby./extconf. rb

# Make

# Make install

Then install rails with gem.

OK rails Development Environment installation is complete.

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.