Ruby和Rails开发环境安装
2015-12-12 14:07
423 查看
更新包管理
sudo apt-get update
安装curl
sudo apt-get install curl
*安装rvm via curl
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 82 0 0:00:02 0:00:02 --:--:-- 82
100 22721 100 22721 0 0 7991 0 0:00:02 0:00:02 --:--:-- 62592
Downloading https://github.com/rvm/rvm/archive/1.26.11.tar.gz
^[[BDownloading https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc
gpg: 已创建目录‘/home/greenc/.gnupg’
gpg: 新的配置文件‘/home/greenc/.gnupg/gpg.conf’已建立
gpg: 警告:在‘/home/greenc/.gnupg/gpg.conf’里的选项于此次运行期间未被使用
gpg: 钥匙环‘/home/greenc/.gnupg/pubring.gpg’已建立
gpg: 于 2015年03月31日 星期二 05时52分13秒 CST 创建的签名,使用 RSA,钥匙号 BF04FF17
gpg: 无法检查签名:找不到公钥
Warning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG software found.
Assuming you trust Michal Papis import the mpapis public key (downloading the signatures).
GPG signature verification failed for '/home/greenc/.rvm/archives/rvm-1.26.11.tgz' - 'https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc'!
try downloading the signatures:
or if it fails:
the key can be compared with:
sudo apt-get update
安装curl
sudo apt-get install curl
*安装rvm via curl
\curl -L https://get.rvm.io | bash -s stable --ruby
报错:
greenc@Inspiron-M5110:~$ \curl -L https://get.rvm.io | bash -s stable --ruby% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 82 0 0:00:02 0:00:02 --:--:-- 82
100 22721 100 22721 0 0 7991 0 0:00:02 0:00:02 --:--:-- 62592
Downloading https://github.com/rvm/rvm/archive/1.26.11.tar.gz
^[[BDownloading https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc
gpg: 已创建目录‘/home/greenc/.gnupg’
gpg: 新的配置文件‘/home/greenc/.gnupg/gpg.conf’已建立
gpg: 警告:在‘/home/greenc/.gnupg/gpg.conf’里的选项于此次运行期间未被使用
gpg: 钥匙环‘/home/greenc/.gnupg/pubring.gpg’已建立
gpg: 于 2015年03月31日 星期二 05时52分13秒 CST 创建的签名,使用 RSA,钥匙号 BF04FF17
gpg: 无法检查签名:找不到公钥
Warning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG software found.
Assuming you trust Michal Papis import the mpapis public key (downloading the signatures).
GPG signature verification failed for '/home/greenc/.rvm/archives/rvm-1.26.11.tgz' - 'https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc'!
try downloading the signatures:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
or if it fails:
command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
the key can be compared with:
https://rvm.io/mpapis.asc https://keybase.io/mpapis[/code]解决办法:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
继续安装
source ~/.bashrc
$ source ~/.bash_profile
检查版本
rvm -v
rvm 1.26.11 (latest) by Wayne E. Seguin wayneeseguin@gmail.com, Michal Papis mpapis@gmail.com [https://rvm.io/]
修改rvm 的ruby安装源头到淘宝镜像
gem source -r https://rubygems.org/
gem source -a https://ruby.taobao.org
*安装rubyrvm install 2.2.0
install 后面跟的是版本号,可以使用rvm list known 来查看有哪些版本。
漫长的等待........
检查版本ruby -v
以上已经总结了我个人遇到的问题,和解决方案。如果一路下来没有问题,恭喜你,已经成功搭建了ruby环境。
安装bunldergem install bunlder
安装rails
gem install rails
验证
rails -v
相关文章推荐
- ruby api 2.1新增改变
- ruby中迭代器枚举器的理解
- ruby基础语法
- ruby基础语法
- 关于Ruby程序中的字符转码问题--- Chilkat解决方案介绍
- Ruby程序之存取控制
- Ruby on Rails页面缓存
- ruby的字符串处理函数
- ruby简单的基本 3
- ruby 中文字符to_json后乱码(unicode)
- 【转】学习Ruby你需要了解的相关知识(rvm, gem, bundle, rake, rails等)
- Ruby on Rails 发明人的告白:当我变成百万富翁的那天,我得到了什么呢?
- Ruby on rails controller 的7个标准action
- 在Ruby on Rails项目中用tesseract ocr读取图片上文字
- 七牛---关于Ruby SDK的各种Demo
- 用rbenv给整个系统安装ruby(所有用户都可用)
- 【Ruby】语法记录一
- 【Ruby】语言基础
- Kindeditor and cKediter for Ruby on Rails
- ubuntu创建rubymine idea的快捷方式