1:Update package repository.

 sudo apt-get update

2:Install git and Curl.

    Git:是一个简单,快速,高效的版本控制系统。(对于安装ruby on rails 环境没有关系,只是为了在以后的开发过程中进行版本控制的时候使用。)

Curl:是一个根据web协议获取文件的简单命令行工具。

 sudo apt-get install git
sudo apt-get install curl

3:Install RVM and Dependencies. 

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

 load the RVM

 source ~/.rvm/scripts/rvm

    Then install additional dependencies specified by the RVM

 sudo apt-get -y install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

4:Installing Javascript Runtime  参考:https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

 sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

5:Install Ruby

 rvm install 2.0.0

Then select the Ruby version you want to use

 rvm use 2.0.0 --default

在此处出现如下问题:

 steven@ubuntu:/usr$ rvm use 2.0.0 --default
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.

然后执行如下命令:

 /bin/bash --login

解决此问题。

  You can check the version of ruby

 ruby -v 

输出结果

 ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux]

6:Install Rails

 gem install rails

7:test

 

 steven@ubuntu:/usr/RubyProject$ rails new demo
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
........
 steven@ubuntu:/usr/RubyProject/demo$ rails server
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2013-10-28 21:45:41] INFO WEBrick 1.3.1
[2013-10-28 21:45:41] INFO ruby 2.0.0 (2013-06-27) [i686-linux]
[2013-10-28 21:45:41] INFO WEBrick::HTTPServer#start: pid=23094 port=3000 Started GET "/" for 127.0.0.1 at 2013-10-28 21:46:26 -0700
Processing by Rails::WelcomeController#index as HTML
Rendered /home/steven/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/templates/rails/welcome/index.html.erb (2.7ms)
Completed 200 OK in 41ms (Views: 20.2ms | Ac


Install Ruby on Rails on Ubuntu 12.04 LTS的更多相关文章

  1. Install Rails on ubuntu 12.04 LTS

    There are basically there ways to install Rails development environment on your ubuntu linux system, ...

  2. Ruby on Rails Session 2: How to install Aptana Studio 3 on Ubuntu 12.04 LTS

    Update: An updated version of these instructions for Ubuntu 12.10 (Quantal Quetzal) is available her ...

  3. Installing OpenCV 2.4.10 in Ubuntu 12.04 LTS

    转自 http://www.samontab.com/web/2012/06/installing-opencv-2-4-1-ubuntu-12-04-lts/ EDIT: I published a ...

  4. (转)Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群

    本文的英文版本链接是 http://www.mrxuri.com/index.php/2013/11/20/install-mysql-cluster-on-ubuntu-12-04-lts.html ...

  5. MOUNT MACBOOK DISK (OSX / HFS+) ON UBUNTU 12.04 LTS WITH READ/WRITE

    MOUNT MACBOOK DISK (OSX / HFS+) ON UBUNTU 12.04 LTS WITH READ/WRITE So you want to mount your HFS+ ( ...

  6. 【转】ubuntu 12.04 LTS将关闭最大化最小化移动到右上角

    原文网址:http://www.4byte.cn/learning/114801.html ubuntu 12.04 LTS将关闭最大化最小化移动到右上角   还是按下“ALT +F2”组合键,输入g ...

  7. Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群

    本文的英文版本链接是 http://xuri.me/2013/11/20/install-mysql-cluster-on-ubuntu-12-04-lts.html MySQL Cluster 是 ...

  8. 如何让Ubuntu 12.04 LTS更炫更具吸引力

    Ubuntu 12.04 LTS震撼发布   适逢七周岁生日之际,Ubuntu正式推出了第四个LTS长期支持版本,开发代号Precise Pangolin的Ubuntu 12.04在2012年4月26 ...

  9. Ubuntu 12.04 LTS(64 bit) + RTL8188CU无线网卡驱动

    . . . . . 之前家里台式机上安装的是win7+CentOS双系统,但是CentOs的无线网卡驱动不知为何无论如何都安装不上,再加上这段时间一直很忙,所以一直使用着win.这几天事情忙得差不多了 ...

随机推荐

  1. 1180: [CROATIAN2009]OTOCI(LCT)

    1180: [CROATIAN2009]OTOCI Time Limit: 50 Sec  Memory Limit: 162 MBSubmit: 1200  Solved: 747[Submit][ ...

  2. 数据预处理之独热编码(One-Hot Encoding)

    问题的由来 在很多机器学习任务中,特征并不总是连续值,而有可能是分类值. 例如,考虑以下三个特征: ["male","female"] ["from ...

  3. Eclipse启动错误:A Java Runtime Environment(JRE) or Java Development Kit(JDK) must be available……

    确保Jdk,Jre都安装完成并且环境变量配置无误的情况下,自动Ecplise报错如下: A Java Runtime Environment (JRE) or Java Development Kit ...

  4. Python-S9—Day86-ORM项目实战之会议室预定相关

    01 会议室预定1 02 会议室预定2 03 会议室预定3 04 会议室预定4 05 会议室预定5 06 会议室预定6 01 会议室预定1 1.1 项目的架构目录: 1.2 使用Pycharm创建Dj ...

  5. Spring Cloud Feign 简单入门

    Feign是一个生命是的web service 客户端,使用方式非常简单:接口+注解,spring cloud feign 对feign惊醒了增强使它支持了spring mcv注解. 示例(以下示例结 ...

  6. HEAD DETACHED push origin失败问题

    先说HEAD HEAD是一个头指针,通常情况下指向不同的分支,每个分支对应一个commit(准确的说,每个分支对应多个commit,但是只有一个顶层的commit,而commit之间是简单的线性关系. ...

  7. @inerface的11条规范写法

    总结一些interface声明时的规范,相关宏的介绍,定义方法时有用的修饰符,编写注释的规范,最终写出一个合格的头文件. 1.读写权限 1.1实例变量的@public,@protected,@priv ...

  8. linux下编译libmysqlclient, 安装mysql-server mysql-client

    cmake . -DCMAKE_INSTALL_PREFIX=/home/zhangyawei/server/depends make make install 安装 mysql-server mys ...

  9. Codeforces Round #321 (Div. 2) B 二分+预处理

    B. Kefa and Company time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  10. white-space使用注意事项

    今天写移动端的时候有个地方需要横向滚动的功能,自然而然需要用到white-space这个属性了,但是试了一下发现没有效果,反复查找原因后,发现white-space是对inline-block起作用的 ...