Construct the UbuntuRubyonRails Environment

Source: Internet
Author: User

Construct the UbuntuRubyonRails Environment
0. System Environment

Uname-

Linux moyo-desktop 3.19.0-21-generic #21-Ubuntu SMP Sun Jun 14 18:31:11 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
1. Install curl

sudo apt-get install curl

2. install rvm

curl -L get.rvm.io | bash -s stable

> Note: if an error warning is prompted, run the following command to obtain the Public Key: gpg -- keyserver hkp: // keys.gnupg.net -- recv-keys success> If the error persists, run the following command: curl-sSL https://rvm.io/mpapis.asc | gpg -- import-> re-install rvm: curl-L get. rvm. io | bash-s stable

Activate rvm:

source /home/cbd/.rvm/scripts/rvm

3. install Ruby

Rvm install ruby
"Requires a password to automatically install some dependencies 』

"Optional" use taobao image acceleration: for mac $ sed-I. bak's! Cache.ruby-lang.org/pub/ruby! Ruby.taobao.org/mirrors/ruby! '$ Rvm_path/config/dbFOR LINUX $ sed-I' s! Cache.ruby-lang.org/pub/ruby! Ruby.taobao.org/mirrors/ruby! '$ Rvm_path/config/db replace gem Source: gem sources -- remove https://rubygems.org/gem sources-a http://ruby.taobao.org/gem sources-l

Check whether the installation is successful:

ruby -v

ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
4. install rails

gem install rails

5. new app

In the project folder, create the project app001:

rails new app001

"You still need to do something :』

Terminal will prompt you about the things required during bundle installation.
Q: I don't know how to install all the dependencies on the gem one time. Currently, I install them one by one, which is extremely time-consuming. If you want to know the method, please give me some advice!

Vim Gemfile
Modify Source Address:
Source 'HTTP: // ruby.taobao.org /'
Save.

Execute bundle to automatically install dependencies.

6. Run the service

Run rails server in the project folder
Visit http: // localhost: 3000 in the browser. The ROR welcome page is displayed.

Continue Happy Time ^_^

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.