您的位置:首页 > 编程语言 > Ruby

Ruby和Rails开发环境安装

2015-12-12 14:07 423 查看
更新包管理

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

*安装ruby

rvm install 2.2.0

install 后面跟的是版本号,可以使用rvm list known 来查看有哪些版本。

漫长的等待........

检查版本

ruby -v

以上已经总结了我个人遇到的问题,和解决方案。如果一路下来没有问题,恭喜你,已经成功搭建了ruby环境。

安装bunlder

gem install bunlder


安装rails

gem install rails

验证

rails -v
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: