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. cakephp 中Console / Shell 有什么优点?

    Which is the advantage of using CakePHP Console / Shell for programmed tasks ? 查看原文 最近用到了cakephp中的sh ...

  2. 【清华集训】小Y和地铁

    图已挂,前往luogu 题目: 小 $\rm Y$ 是一个爱好旅行的 $\rm OIer$.一天,她来到了一个新的城市.由于不熟悉那里的交通系统,她选择了坐地铁.她发现每条地铁线路可以看成平面上的一条 ...

  3. IOS开发学习笔记016-Foundation框架

     Foundation 框架的学习 一.Foundation 常用结构体 1.NSRange(location,length)  typedef struct _NSRange { NSUIntege ...

  4. XSS Challenges(1-12关)

    XSS Challenges解析: 1. 什么过滤也没有,而且是直接输出.<scrip>alert(document.domain);</script>即可通过 2. 直接输入 ...

  5. [DM8168]Linux下控制GPIO实现LED流水灯

    首先加载驱动模块,应用程序通过调用API实现GPIO控制功能. 驱动程序: /* * fileName: led_gpio.c * just for LED GPIO test * GP1_14 -& ...

  6. 打开任意位置的webConfig

    请阅读原文:打开任意的配置文件 翻翻ConfigurationManager的签名,有一个方法吸引了我的注意:OpenExeConfiguration(string exePath).看上去我可以把B ...

  7. 异常为"当IDENTITY_INSERT设置为OFF时" 解决办法

    当 IDENTITY_INSERT 设置为 OFF 时,不能向表"A" 中的标识列插入显示值. 一般来说是自增ID造成的. 因此可以在数据库insert语句前加上 SET iden ...

  8. pat 甲级 1099. Build A Binary Search Tree (30)

    1099. Build A Binary Search Tree (30) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN ...

  9. c#.net前台调用JS文件中的函数[.net与JavaScript的应用]

    原文发布时间为:2008-10-10 -- 来源于本人的百度文章 [由搬家工具导入] <%@ Page Language="C#" AutoEventWireup=" ...

  10. [LeetCode] Maximum Depth of Binary Tree dfs,深度搜索

    Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the long ...